当前位置:网站首页>Docker method to install MySQL

Docker method to install MySQL

2022-07-07 01:17:00 love_ 521_

docker install mysql Whole process , Since using docker, I like this artifact more and more , The installation method is simple and clear , Installation method: :

Pull the mirror image

docker pull mysql:5.7 --platform linux/x86_64

Look at the mirror image

docker images

Create related folders

mkdir -p ~/mydocker/mysql/conf
mkdir -p  ~/mydocker/mysql/logs
mkdir -p  ~/mydocker/mysql/data
chmod -R 777 ~/mydocker/mysql/

Run container

docker run -p 3306:3306 --name mysql -v ~/mydocker/mysql/conf:/etc/mysql/conf.d -v ~/mydocker/mysql/logs:/var/log/mysql -v ~/mydocker/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci

Look at the container

docker ps
原网站

版权声明
本文为[love_ 521_]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207061729516059.html