access denied for user 'root'@'localhost'
修改mysql的root用户密码后,登陆,提示如标题的错误:
1.设置mysql配置文件:
跳过密码登陆
[mysqld]
skip-grant-tables
3.进入mysql: mysql -u root -p
4.use mysql;
5. update user set password=password("123456") where user="root";// 设置密码
或者
5.delete from user where user=''; 删除空用户
6,flush privileges;
7,quit
8.屏蔽或删除skip-grant-tables
9.重启mysql