查看mysql版本
docker search mysql
拉取镜像
docker pull mysql
运行:
docker run -d -p 10002:3306 -e MYSQL_ROOT_PASSWORD=root mysql:latest
挂载
docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -e TZ=Asia/Shanghai -v /data/docker/mysql/conf.d:/etc/mysql/conf.d/ -v /data/mysql/:/var/lib/mysql/ mysql
进入镜像
docker exec -it xxxxx /bin/bash
mysql -uroot -P 3306 -p
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';
sudo docker pull bunchjesse/mysql5.6
docker run -d -p 10000:3306 -e MYSQL_ROOT_PASSWORD=root -e TZ=Asia/Shanghai -v /data/docker/mysql/conf.d:/etc/mysql/conf.d/ -v /data/mysql/:/var/lib/mysql/ mysql
docker exec -it xxxxx /bin/bash
mysql -uroot -proot
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';