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

How to access the database in the docker container

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article to share with you is about how to access the database in the docker container, Xiaobian think it is very practical, so share it with you to learn, I hope you can gain something after reading this article, not much to say, follow Xiaobian to see it.

How to access the database in docker container? MySQL is an open source relational database management system that is very popular among database systems. How to access MySQL database in docker container

MySQL database installation

1. Query mysql version

docker search mysql

2. Download MySQL version 5.7

docker pull mysql:5.7 (here is the first mysql image selected,:5.7 version 5.7 selected)

3. Wait for download to complete, create MySQL container

docker create --name mysql3308 -e MYSQL_ROOT_PASSWORD=root -p 3308:3306 mysql:5.7

Create container name mysql3308, password root

4. start the container

docker start mysql3308

5. into the container

docker exec -it mysql3308 bash

6. MySQL connection

mysql -uroot -p

The above is how to access the database in the docker container. Xiaobian believes that some knowledge points may be seen or used in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

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

Servers

Wechat

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

12
Report