在修改mysql的root用户密码后,再登陆,提示如标题的错误,找了一番答案之后,终于解决,步骤如下:
1.停掉mysql: service mysqld stop
2.使用不验证的状态登陆mysql:
mysqld_safe --skip-grant-tables & //后台运行
启动mysql: service mysqld start
3.进入mysql: mysql -u root
4.use mysql;
5.delete from user where user=‘‘; 删除空用户
6.flush previlige; 刷新权限
7.service mysqld restart
8.问题解决
解决Access denied for user ''@'localhost' to database 'mysql'问题,布布扣,bubuko.com
解决Access denied for user ''@'localhost' to database 'mysql'问题