Mysql 查看版本号后修改对于版本的root密码

2022-02-07 20:19
207
0

select version();

mysql5.6;
update `user` set password=password('12345678') where user='root'; 
flush privileges;

mysql5.7;
update `user` set authentication_string=password('12345678') where user='root'; 
flush privileges;

mysql5.8;
ALTER USER 'root'@localhost  IDENTIFIED BY '12345678';
FLUSH PRIVILEGES; 

全部评论