首页 > 代码库 > mysql提示:1045 access denied for user'root'@'localhost' using password yes

mysql提示:1045 access denied for user'root'@'localhost' using password yes

1.打开DOS进入mysql下bin目录(C:\Program Files\MySQL\MySQL Server 5.6\bin)

2.停止mysql服务,net stop  mysql

3.输入:mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server 5.6\my-default.ini" --console --skip-grant-tables

4.重新打开一个DOS窗口,进入mysql下bin目录,输入:mysql -root  -p

5.提示输入密码,在Enter后面输入密码,进入mysql>

6.输入update (数据库名称) set password=PASSWORD(‘newpassword‘) where USER=‘root‘

7.输入FLUSH PRIVILEGES;

8.输入quit

OK!!!!!!!!!

mysql提示:1045 access denied for user'root'@'localhost' using password yes