docker run -p 3307:3306 --name mysql-container -v /www/mysql/slave/log:/var/log/mysql -v /www/mysql/slave/data:/var/lib/mysql -v /www/mysql/slave/config/my.cnf:/etc/my.cnf -e MYSQL_ROOT_PASSWORD=Wenchen@xuan05186316 -e identified=mysql_native_password -d mysql:8.0.24
docker exec -it mysql-container
use mysql;
update user set host='%' where user='root' ;
grant all privileges on *.* to 'root'@'%' ;
flush privileges ;
select host from user where user='root';
alter user 'root'@'%' identified with mysql_native_password by 'Wenchen@xuan05186316';
select host, user, authentication_string, plugin from user
alter user 'root'@'%' identified with mysql_native_password by '123456';
docker run -d --name mysql-container -e MYSQL_ROOT_PASSWORD=123456 -p 3307:3306 -e identified=mysql_native_password mysql:8.0.24