登录mysql mysql -u root -p 或 mysql

use mysql;

update user set authentication_string=PASSWORD("密码") where user='root';

update user set plugin="mysql_native_password";

flush privileges;

exit;

service mysql restart;

MySql 5.7 修改root密码,解决不用密码也能登录问题
标签: