当前位置:网站首页>Docker installs MySQL 8.0. Detailed steps
Docker installs MySQL 8.0. Detailed steps
2022-06-24 22:21:00 【Nice2cu_ Code】
Docker install MySQL 8.0
List of articles
One 、 Pull the mirror image
docker pull mysql:8.0.21
Two 、 Look at the mirror image
docker images

3、 ... and 、 Run container
docker run -it -d --name mysql --net=host \
-m 500m -v /root/mysql/data:/var/lib/mysql \
-v /root/mysql/config:/etc/mysql/conf.d \
-e MYSQL_ROOT_PASSWORD=abc123456 \
-e TZ=Asia/Shanghai mysql:8.0.21 \
--lower_case_table_names=1
Code meaning :
docker run -p Local host port number : Container service port number --name Container name [-e Configuration information modification ] -d Mirror name
- conf.d Is the configuration file of the database
- MYSQL_ROOT_PASSWORD Specify database password , The default account name is root
- lower_case_table_names=1 Turn off case sensitivity for database names
Four 、 Check operation
docker ps

5、 ... and 、 Into the container
docker exec -it mysql8.0 /bin/bash
6、 ... and 、 To configure MySQL
1. Get into MySQL

2. Configure support for remote connections
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'MySQL Password ';
# Refresh database
flush privileges;

边栏推荐
猜你喜欢
随机推荐
Yida technology signed a contract with seven wolves to help the digital transformation of "Chinese men's wear leader"
AQS源码分析
Development trend and path of SaaS industry in China
Filtered data analysis
字符串习题总结2
Several schemes of traffic exposure in kubernetes cluster
刷题笔记(十八)--二叉树:公共祖先问题
leetcode:45. 跳跃游戏 II【经典贪心】
linq查询集合类入门 案例武林高手类
leetcode:55. Jumping game [classic greed]
Huada 04A operating mode / low power consumption mode
socket done
Heartless sword Chinese English bilingual poem 003 The sea of books
leetcode_ one thousand three hundred and sixty-five
进程的通信方式
How to automatically remove all . orig files in Mercurial working tree?
Réduire le PIP à la version spécifiée (mettre à jour le PIP avec pycharm avant de le réduire à la version originale)
Description of software version selection of kt6368a Bluetooth dual-mode transparent chip
“阿里健康”们的逻辑早就变了
如何比较两个或多个分布:从可视化到统计检验的方法总结









