docker pull mysql:5.6
docker images
docker run -itd -P mysql:5.6 bash
docker ps -a
docker exec -it relaxed_hodgkin bash
service mysql start
use mysql; # 進入管理員的數據庫中 update user set authentication_string = password('123456') where user = 'root'; # 修改密碼爲123456
# update user set password=PASSWORD('123456') where user='root';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
flush privileges;
exit
service mysql restart
mysql -u root -h MySQL服務所在的IP地址 -p # 回車,輸入密碼(教程中是123456)就 OK 了