linux docker mounting start MySQL (data configuration to the host)

Installed MySql PS: docker install nginx  https://blog.csdn.net/wu__peng/article/details/90904409

Download the latest mysql: docker pull mysql (do not specify a tag is to download the latest, great, recommended to specify version)

Download specified mysql: docker pull mysql: 5.7

Major Tips: 1, MySql time to put his memory to be mapped to a local path, or removal of the mirror, they had nothing with

Parameter Description:

-e MYSQL_USER = "woniu": Add user woniu

-e MYSQL_PASSWORD = "123456": Set the user's password to add

-e MYSQL_ROOT_PASSWORD = "123456": Set the root user password

--character-set-server = utf8: a character set that utf8

--collation-server = utf8_general_cli: Set the character comparison rules as utf8_general_cli

 

I used the following command:

Data, arranged in / home / mysql inside

docker run --name mysql -e MYSQL_ROOT_PASSWORD=pass1234 -v /home/mysql/conf.d:/etc/mysql/conf.d -v /home/mysql/data:/var/lib/mysql -p 3306:3306 -d mysql:5.7 

 

Guess you like

Origin blog.csdn.net/wu__peng/article/details/90905399