Sign inSign up

dawneve/mysql

By dawneve

•Updated about 9 years ago

Image
0

166

dawneve/mysql repository overview

⁠1. run, with -p port and -v dir projection, outer: inner

$ docker run -p 7070:3306 -d -it -e MYSQL_ROOT_PASSWORD=123456 -v /home/wangjl/dockerFile:/var/lib/mysql dawneve/mysql
## set your passwd above, here we use 123456 as an example
## use -v, so that we can reserve our MySql files even the containner was destroyed somehow.

⁠2. connect to MySql from

$ mysql -h yourIP -P 7070 -u root -p

⁠3. access the container

$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
b919662117cc        dawneve/mysql       "docker-entrypoint.s."   5 hours ago         Up 5 hours          0.0.0.0:7070->3306/tcp   peaceful_shtern

$ docker exec -it b919 bash
root@b919662117cc:/# cd /var/lib/mysql
root@b919662117cc:/var/lib/mysql# ls -lth

Tag summary

Content type

Image

Digest

Size

136.9 MB

Last updated

about 9 years ago

docker pull dawneve/mysql