banner
{小朋友}

xiaopy

docker installation mysql

View available versions of MySQL

docker search mysql

image-20220929214307857

Install MySQL image

docker pull mysql

image-20220929214449967

Check the image (to see if the installation was successful)

docker images

image-20220929214543783

Run MySQL

--name mysql-3306 is an alias, you can use it to start and stop MySQL. You can also use the automatically generated ID.

docker run -itd --name mysql-3306 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql

Check if it is running successfully

docker ps

image-20220929214835032

Enter the MySQL container

# Enter the MySQL container
docker exec -it mysql-3306 bash

# Enter MySQL and enter the password (123456)
mysql -u root -p

image-20220929215142521

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.