Use Docker to build a MySQL application

Source: Internet
Author: User
Tags docker run

MySQL server is the most popular open source database server, the following describes how to use Docker to make a MySQL database service

Pull a MySQL image directly from the website
[Email protected] ~/base $ docker Pull dl.dockerpool.com: the/mysql:5.7Pulling Repository dl.dockerpool.com: the/mysqle95cbb9f48ea:download Complete511136Ea3c5a:download Complete5A7d9470be44:download Completefeb755848a9a:download Complete034656F0ad7b:download Completed30d97371f31:download Complete .Fcd079bef3:download Complete2702D110a524:download COMPLETED46D6A3CD040:download Completeb6ce9f97ca75:download Complete theC6cebccd5a:download Completeb9e91c841f3b:download Complete5Bc8425e8dff:download Complete2A35d8172e2d:download Complete43279C8daf8e:download Complete GenevaC1bd631e20:download Complete7Ea4b0fe19cc:download Complete[email protected] ~/base $ docker Tag dl.dockerpool.com: the/mysql:5.7Mysql:5.7[Email protected] ~/base $ docker imagesrepository TAG IMAGE ID CREATED VIRTUAL sizebase/163Latest468D347c06bc5Hours ago249.1MBdl.dockerpool.com: the/mysql5.7E95cbb9f48ea5Days ago258.6Mbmysql5.7E95cbb9f48ea5Days ago258.6MB
Start the MySQL container
[Email protected] ~/base $ docker run--name db001-p3306:3306  - eMysql_root_password=admin- DMysql:5.7#上面这条语句启动了一个名字叫 db001 container, his root password is admin, mapping the host host port 3306 to the container port 3306, these are manually specified. [Email protected] ~/base $ docker pscontainer ID IMAGE COMMAND CREATED STATUS PORTS namesfb4b9ab6a2ba dl.dockerpool.com: the/mysql:5.7   "/entrypoint.sh mysq 2 seconds ago up 2 seconds 0.0.0.0:3306->3306/tcp

So that we can use the MySQL server, the next chapter will show you how to open the Tomcat container link to this db001 database container

Use Docker to build a MySQL application

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.