Docker install MySQL

Source: Internet
Author: User
Tags docker run

The company wants to use Docker, test it first.

# to install, run the following commands as root:

Curl-fsslo https://get.docker.com/builds/Linux/x86_64/docker-1.12.1.tgz && Tar--strip-components=1-xvzf Docker-1.12.1.tgz-c/usr/local/bin

# then start Docker in daemon mode:

/usr/local/bin/dockerd &

Check if the installation was successful

[[email protected] ~]# Docker versionclient:version:1.12.1 API version:1.24 Go version:go1.6.3 Git commit:2 3cf638 built:thu 17:52:38 os/arch:linux/amd64server:version:1.12.1 API version:1.24 Go version:go1.6.3 Git commit:23cf638 Built:thu 17:52:38 os/arch:linux/amd64

If the version number of the Docker is output, the installation is successful.

Download a MySQL image

[email protected] apps]# Docker pull mysql:5.75.7:pulling from Library/mysql6a5a5368e0c2:pull complete 0689904e86f0:p ull complete 486087a8071d:pull Complete 3eff318f6785:pull complete 3df41d8a4cfb:pull complete 1b4a00485931:pull comple Te 0bab0b2c2630:pull complete 264fc9ce512d:pull complete e0181dcdbbe8:pull complete 53b082fa47c7:pull complete E5CF4FE 00c4c:pull Complete Digest:sha256:966490bda4576655dc940923c4883db68cca0b3607920be5efff7514e0379aa7status: Downloaded newer image for mysql:5.7

Launch the MySQL Docker container

[email protected] ~]# Docker run--name mysql001-p 3306:3306-e mysql_root_password=xxxxxxxx-d mysql:5.7d3e0171c5ec8a72 0f66e6fccde4c4033007e6b1b15fabb4fd06537f34fd85a42

View all containers that are already running

[[email protected] ~]# docker pscontainer id         IMAGE                command                   CREATED             STATUS               PORTS                     namesd3e0171c5ec8         mysql:5.7             "docker-entrypoint.sh"    9 minutes ago        up 9 minutes        0.0.0.0:3306->3306/ tcp   mysql001

Connection

mysql-uroot-pxxxxxxxx-h192.168.1.201


This article is from the "just out of the shell of the Birds" blog, please be sure to keep this source http://qhd2004.blog.51cto.com/629417/1860143

Docker install MySQL

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.