登录mysql ,执行以下语句
update mysql.user set authentication_string=PASSWORD("密码") where user='root';
update mysql.user set plugin="mysql_native_password";
flush privileges;
quit;
重启mysql服务
service mysql restart;
或者/etc/init.d/mysql restart
登录mysql ,执行以下语句
update mysql.user set authentication_string=PASSWORD("密码") where user='root';
update mysql.user set plugin="mysql_native_password";
flush privileges;
quit;
重启mysql服务
service mysql restart;
或者/etc/init.d/mysql restart