docker pull mysql:latest
docker run -itd --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql
docker exec -it mysql bash
mysql -h localhost -u root -p
1 use mysql;
2 ALTER user 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
3 FLUSH PRIVILEGES;
docker restart CONTAINER ID
----------------------------- 备忘记录,快速上手操作