docker provides local mysql service

Article directory

1 needs

  • Provide mysql service locally through docker (no need to install mysql)

2 orders

  • docker command
 docker run -dp 3306:3306 `
 -v mysql-data:/var/lib/mysql `
 -e MYSQL_ROOT_PASSWORD=root `
 -e MYSQL_DATABASE=user_info `
 mysql:5.7

Note: When starting docker, set the port, otherwise it cannot be accessed locally

When the command is executed for the first time, it appears: unable to find image 'mysql:5.7'
Waiting for the image to be downloaded
insert image description here

Guess you like

Origin blog.csdn.net/lanxing_huangyao/article/details/123044396