2016-02-25 05:03
在Win10 x64下安装mysql-5.7.11之后,使用root登录mysql时候,显示如下:
C:\MySQL> mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
my.ini
,在[mysqld]
的下一行添加skip-grant-tables
,如下样子[mysqld]
skip-grant-tables
保存后退出C:\MySQL> net stop mysql
C:\MySQL> net start mysql
mysql> mysql -u root -p
mysql> use mysql
mysql> update user set authentication_string=password("new_password") where user="root";
mysql> flush privileges;
mysql> quit
skip-grant-tabels
删除并保存退出