阿里云esc服务器Docker部署单节点Mysql的讲解

1.下载加速版msyql  

docker pull hub.c.163.com/library/mysql:5.7

2.更名

docker tag hub.c.163.com/library/mysql:5.7 mysql:5.7

3.启动

docker run -it --rm --name mysql -e MYSQL_ROOT_PASSWORD=123456 -p 3306:3306 -d mysql

4.设置mysql远程登录

docker exec -it mysql bash 
mysql -uroot -p123456
ALTER user 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';

相关推荐