docker pull mysql:5.6
docker run -itd -P mysql:5.6 bash
docker attach (容器name) # 进入容器
service mysql status
service mysql start
mysql #进入mysql命令行
use mysql;
update user set authentication_string = password('root') where user = 'root'; #创建root密码
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;#外部访问
ctrl +p ++ ctrl + q #挂起容器
哈哈哈,就是这么舒服。



