MySQL8.0以上修改密码报错
进入mysql库
use mysql;
刷新权限
mysql> flush privileges;
清空密码
mysql> UPDATE user SET authentication_string="" WHERE user=“root”;
刷新权限
mysql> flush privileges;
设置root的新的密码
mysql>alter user’root’@’%’ IDENTIFIED BY 'test123 ';
刷新权限
mysql> flush privileges;
退出mysql,清除my.cnf的skip-grant-tables后重启mysql
systemctl restart mysqld.service