问题原文
原帖链接 · Ben Holness · CC BY-SA 3.0
I have MySQL running on a virtual machine on my laptop within a host only network (no access to the wider internet except when I turn on the NAT interface to update the O/S). For convenience, I have the root user with no password. I have a number of projects that are setup to access the database this way within my development environment.
I just did an apt-get upgrade, which included updating MySQL to 5.7.18 (I am running Ubuntu 16.04.2 LTS) and now all of my projects are getting access denied. I am not sure which version MySQL was at before the update.
From the console, I can mysql --user=root with no problems if I am logged in as root, but not if I am logged in as anyone else.
Can anyone help determine what the update changed and how I can configure MySQL to allow root user access with no password again?
已采纳解答
原帖链接 · Ben Holness · CC BY-SA 3.0
I'm not sure if the update changed the plugin for root@localhost or if the plugin remained unchanged and MySQL's behavior changed, but I resolved this problem by changing the plugin for root@localhost to mysql_native_password with the following SQL:
UPDATE user SET plugin='mysql_native_password' WHERE user='root' AND host='localhost';
FLUSH PRIVILEGES;
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
