在重新启动mysql时,我遇到了错误,其中之一是
2013-05-16 12:48:06 56189 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
我决定尝试 mysql_upgrade,但是失败了:
Pavel-Kodentsevs-MacBook-Pro:bin pavelkodentsev$ ./mysql_upgrade -u root -p
Enter password:
Looking for 'mysql' as: ./mysql
Looking for 'mysqlcheck' as: ./mysqlcheck
Running 'mysqlcheck with default connection arguments
Warning: Using a password on the command line interface can be insecure.
./mysqlcheck: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect
FATAL ERROR: Upgrade failed
这可能是什么原因造成的?Pass 是对的,我检查了好几遍了。
答案1
拒绝用户“root”@“localhost”访问(使用密码:是)
它无法从 localhost 以 root 身份连接到本地 mysql 服务器。你试过https://dev.mysql.com/doc/refman/5.5/en/access-denied.html
尝试重命名 .my.cnf(如果有)
mv /root/.my.cnf /root/.my.cnf.bak
并重新运行该命令。