Worked for me and "5.7.11 MySQL Community Server":
use mysql;
update user set authentication_string=password(''), plugin='mysql_native_password' where user='root';
I had to change the 'plugin' field as well because it was set to 'auth_socket'.
After that I could connect as mysql -u root
without a password.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…