时间:2021-07-01 10:21:17 帮助过:5人阅读
1.拉取镜像
docker pull mysql
2.创建容器
docker run -p 3306:3306 --name mysql -e MYSQL_ROOT_PASSWORD=123456 -v /home/docker/mysql:/var/lib/mysql -d mysql
3.配置mysql允许外部连接
grant all PRIVILEGES on *.* to root@‘%‘ WITH GRANT OPTION; ALTER user ‘root‘@‘%‘ IDENTIFIED BY ‘root@123456‘ PASSWORD EXPIRE NEVER; ALTER user ‘root‘@‘%‘ IDENTIFIED WITH mysql_native_password BY ‘root@123456‘;
docker创建mysql镜像
标签:doc ant mysq sharp ati user nat mys alt