Docker 安装 MySQL
方法一、docker pull mysql
1、Docker Hub上的mysql镜像
docker search mysql
[root@localhost mysql]# docker search mysql NAME DESCRIPTION STARS OFFICIAL AUTOMATED mysql MySQL is a widely used, open-source relation… 8591 [OK] mariadb MariaDB is a community-developed fork of MyS… 2984 [OK] mysql/mysql-server Optimized MySQL Server Docker images. Create… 632 [OK] centos/mysql-57-centos7 MySQL 5.7 SQL database server 62 centurylink/mysql Image containing mysql. Optimized to be link… 61 [OK] mysql/mysql-cluster Experimental MySQL Cluster Docker images. Cr… 51 deitch/mysql-backup REPLACED! Please use http://hub.docker.com/r… 41 [OK] tutum/mysql Base docker image to run a MySQL database se… 34 bitnami/mysql Bitnami MySQL Docker Image 33 [OK] schickling/mysql-backup-s3 Backup MySQL to S3 (supports periodic backup… 28 [OK] prom/mysqld-exporter 22 [OK] linuxserver/mysql A Mysql container, brought to you by LinuxSe… 21 centos/mysql-56-centos7 MySQL 5.6 SQL database server 16 circleci/mysql MySQL is a widely used, open-source relation… 14 mysql/mysql-router MySQL Router provides transparent routing be… 12 arey/mysql-client Run a MySQL client from a docker container 11 [OK] imega/mysql-client Size: 36 MB, alpine:3.5, Mysql client: 10.1.… 7 [OK] openshift/mysql-55-centos7 DEPRECATED: A Centos7 based MySQL v5.5 image… 6 yloeffler/mysql-backup This image runs mysqldump to backup data usi… 6 [OK] fradelg/mysql-cron-backup MySQL/MariaDB database backup using cron tas… 4 [OK] genschsa/mysql-employees MySQL Employee Sample Database 2 [OK] jelastic/mysql An image of the MySQL database server mainta… 1 ansibleplaybookbundle/mysql-apb An APB which deploys RHSCL MySQL 1 [OK] widdpim/mysql-client Dockerized MySQL Client (5.7) including Curl… 0 [OK] monasca/mysql-init A minimal decoupled init container for mysql 0
拉去mysql.6镜像,标签为5.6
docker pull mysql:5.6
2、使用msyql镜像
docker run -p 3306:3306 --name mymysql -v $PWD/conf:/etc/mysql/conf.d -v $PWD/logs:/logs -v $PWD/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.6