Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Steps for docker to install mysql

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "the steps of installing mysql in docker". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the steps of installing mysql in docker.

Docker installs mysql1. Download image sudo docker pull mysql:5.7

Ubuntu@VM-0-13 Murubuntuvus sudo docker pull mysql:5.7

5.7: Pulling from library/mysql

C499e6d256d6: Pull complete

22c4cdf4ea75: Pull complete

6ff5091a5a30: Pull complete

2fd3d1af9403: Pull complete

0d9d26127d1d: Pull complete

54a67d4e7579: Pull complete

Fe989230d866: Pull complete

466a91a95e2f: Pull complete

3e4554c238f1: Pull complete

603b48ead88c: Pull complete

1e86a9aa7171: Pull complete

Digest: sha256:fbaeced79cfdae5d3c8d4a8c41e883f254f72ed7428c6b93a498824b76d97121

Status: Downloaded newer image for mysql:5.7

Docker.io/library/mysql:5.7

two。 View the downloaded image sudo docker images

3. Create mysql instance and start create mysql instance and start sudo docker run-p 3306 sudo docker run 3306-name mysql\

-v / mydata/mysql/log:/var/log/mysql\

-v / mydata/mysql/data:/var/lib/mysql\

-v / mydata/mysql/conf:/etc/mysql\

-e MYSQL_ROOT_PASSWORD=root\

-d mysql:5.7

Parameter description

-p 3306virtual 3306 maps port 3306 of the container to the host

-v / mydata/mysql/log:/var/log/mysql\ Mount the log file to the host

-v / mydata/mysql/data:/var/lib/mysql\ Mount the data file to the host

-v / mydata/mysql/conf:/etc/mysql\ Mount the configuration file to the host

Mark

View docker Container

Mysql container started

4. Connect to database using Workbench to connect to database

Check the database mark5. Enter the mysql container sudo docker exec-it mysql / bin/bash

6. View the virtual machine mapping file cd / mydata/mysql

Ls

At this point, I believe that you have a deeper understanding of the "steps to install mysql in docker". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report