Difference between revisions of "Docker install of mysql"

From MyWiki
Jump to: navigation, search
Line 5: Line 5:
  
 
</source>
 
</source>
# Note, below the "mysql" directory must be created before running the command
+
Note, below the "mysql" directory must be created before running the command
 
<source lang="bash">
 
<source lang="bash">
 
docker run  --name devtest -e MYSQL_ROOT_PASSWORD=<password> -d --mount type=bind,source="$(pwd)"/mysql,target=/var/lib/mysql mysql:latest
 
docker run  --name devtest -e MYSQL_ROOT_PASSWORD=<password> -d --mount type=bind,source="$(pwd)"/mysql,target=/var/lib/mysql mysql:latest

Revision as of 18:57, 31 July 2023

Reference: https://hub.docker.com/_/mysql

docker run --name mysql-8 -e MYSQL_ROOT_PASSWORD=<password> -d mysql:8.0.33
docker inspect mysql-8

Note, below the "mysql" directory must be created before running the command

docker run  --name devtest -e MYSQL_ROOT_PASSWORD=<password> -d --mount type=bind,source="$(pwd)"/mysql,target=/var/lib/mysql mysql:latest