In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to install mysql in docker. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
Docker installs mysql by querying and downloading the image with the code [docker images], then creating and running the container with the code [docker run-d-p 3306 MYSQL_ROOT_PASSWORD 3306-e MYSQL_ROOT_PASSWORD], and finally configuring the relevant data.
Docker how to install mysql:
Install from the mirror market.
1. Query the image
Docker search mysql
2. Download the image (in the process of actual measurement, it often gets stuck when downloading the image, just try a few more times)
Docker pull mysql
View the local image through the docker images command
Docker images
3. Create and run the container
Docker run-d-p 3306 3306-e MYSQL_ROOT_PASSWORD=abc123 mysql
Parameter description:
-p 3306purl 3306 maps host port 3306 to container 3306 port
-e MYSQL_ROOT_PASSWORD=abc123 sets the root password for remote login to abc123
-- name zyz-name is optional. Set container alias.
Mysql image name
4. Need to configure data to ignore case
In the mysql8 version, once mysql is officially running, you can no longer set to ignore case. A forced setting will cause the mysql service to fail to start. Therefore, we must mount the mysql configuration to the container when creating the container.
1) create a folder / etc/mysql.d
Cd / etc/ enter the etc directory mkdir mysql.d / / create a folder mysql.d with a variable name
2) add the configuration file my.cnf and configuration to the mysql.d folder
[mysqld] lower_case_table_names=1
3) recreate and run the container
Docker run-d-p 3306 docker run-e MYSQL_ROOT_PASSWORD=abc123-v / etc/mysql.d:/etc/mysql/conf.d-- name zyz-mysql mysql
4) check the effect. After executing the command, lower_case_table_names=1 indicates success.
On docker installation mysql method to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.