https://cloud.tencent.com/developer/article/1439653
https://www.runoob.com/docker/docker-install-mysql.html
CentOS8 安装 Docker:
https://blog.csdn.net/l1028386804/article/details/105480007/
1、查找镜像
docker search mysql
2、下载镜像
docker pull mysql/mysql-server:5.7
可以通过 docker image ls
查看已下载的镜像
3、创建容器
docker run --name mysql1 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql/mysql-server:5.7
查看容器启动情况docker ps
查到容器id
4、进入容器 docker exec -it id /bin/bash
5、登录mysqlmysql -u root -p
常用docker命令参考:https://www.runoob.com/docker/docker-command-manual.html
挂载启动配置
https://www.cnblogs.com/weile0769/p/11863779.html
添加远程登录用户
CREATE USER 'liaozesong'@'%' IDENTIFIED WITH mysql_native_password BY 'Lzslov123!'; GRANT ALL PRIVILEGES ON *.* TO 'liaozesong'@'%';