设置跳过密码 skip-grant-tables
后续命令,请按顺序进行
docker exec -it mysql3308 /bin/bash
======================================
docker restart mysql3308
======================================
mysql -uroot -p 回车即可免密登陆
======================================
use mysql;
======================================
update user set authentication_string='' where user='root';
======================================
flush privileges;
======================================
update user set Host='%' where User='root';
======================================
flush privileges;
======================================
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root12';
======================================
flush privileges;