更改wamp的mysql密码

来源:互联网 发布:office替代软件 编辑:程序博客网 时间:2024/05/23 01:21


 

再开一个dos窗口,同样切到mysql bin目录下,D:\Program Files\MySQL\MySQL Server 5.6\bin>mysql -u rootmysql,回车

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.6.20 MySQLCommunity Server (GPL)

mysql>

 

已连接上mysql数据库,可以输入mysql命令了。

3、设置密码

mysql> update user setpassword=PASSWORD('password') where user='root';

Query OK, 2 rows affected (0.02sec)

Rows matched: 3 Changed: 2 Warnings: 0

mysql> FLUSH PRIVILEGES; 

mysql> quit 

之后按正常方法连接mysql就可以了。如果不能连接,查看下mysql服务是否启动。

 

来自 <http://blog.csdn.net/tuenbotuenbo/article/details/38921775/


OR。。。。。


要先退出mysql的命令行界面,然后运行windows的命令行,进入安装路径下的bin文件夹,然后有两种方法:

方法1mysql -u用户名 -p密码(注意-u和用户名及-p和密码间均无空格,密码没有单引号)

方法2mysql -u 用户名 -p 数据库名 回车后输入用户密码即可

 

来自 <http://bbs.csdn.net/topics/120008071/


0 0
原创粉丝点击