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 install mysql 5.7in docker

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

I believe many inexperienced people don't know what to do about how to install mysql 5.7in docker. Therefore, this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

First search for mysql from docker hub and select the tag you want. I choose mysql:5.7 here.

Docker pull mysql:5.7

To see if the download was successful:

Docker image lsREPOSITORY TAG IMAGE ID CREATED SIZEmysql 5.7 f6509bac4980 11 days ago 373MB

Run the container, where the port mapping is set and the initial password of mysql is set. The default user name is root.

Docker run-d-- name mysql-p 3306 MYSQL_ROOT_PASSWORD=123456 mysql:5.7

Check the container running status:

Docker container lsCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESe87ae06931c8 mysql:5.7 "docker-entrypoint.s..." 4 seconds ago Up 3 seconds 0.0.0.0 3306/tcp 3306-> 33060/tcp mysql

The container is running normally. Enter the container:

Docker exec-it mysql / bin/bashroot@e87ae06931c8:/# mysql-uroot-pmysql > create database test; after reading the above, have you mastered how to install mysql 5.7in docker? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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