当前位置:网站首页>Docker 安装 MySQL 8.0,详细步骤
Docker 安装 MySQL 8.0,详细步骤
2022-06-24 19:34:00 【Nice2cu_Code】
Docker 安装 MySQL 8.0
一、拉取镜像
docker pull mysql:8.0.21
二、查看镜像
docker images

三、运行容器
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
代码含义:
docker run -p 本地主机端口号:容器服务端口号 --name 容器名字 [-e 配置信息修改] -d 镜像名字
- conf.d是数据库的配置文件
- MYSQL_ROOT_PASSWORD指定数据库密码,账户名默认是root
- lower_case_table_names=1关闭数据库名大小写区分
四、查看运行情况
docker ps

五、进入容器
docker exec -it mysql8.0 /bin/bash
六、配置MySQL
1. 进入MySQL

2. 配置支持远程连接
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'MySQL的密码';
#刷新数据库
flush privileges;

边栏推荐
- [untitled]
- 华大4A0GPIO设置
- 零代码即可将数据可视化应用到企业管理中
- A pit in try with resources
- That is to say, "live broadcast" is launched! One stop live broadcast service with full link upgrade
- 985测试工程师被吊打,学历和经验到底谁更重要?
- These map operations in guava have reduced my code by 50%
- try-with-resources 中的一个坑,注意避让
- Summary of papers on traveling salesman problem (TSP)
- PyCharm 中出现Cannot find reference ‘imread‘ in ‘__init__.py‘
猜你喜欢
![Find the maximum value in each tree row [extension of one of the hierarchical traversals]](/img/5b/81ff20b61c0719ceb6873e44878859.png)
Find the maximum value in each tree row [extension of one of the hierarchical traversals]

Servlet详解
![leetcode:45. Jumping game II [classic greed]](/img/69/ac5ac8fe22dbb8ab719d09efda4a54.png)
leetcode:45. Jumping game II [classic greed]

“阿里健康”们的逻辑早就变了

How to extract dates from web pages?

leetcode:55. 跳跃游戏【经典贪心】

KT6368A蓝牙双模透传芯片软件版本选型说明

Detailed installation and use of performance test tool wrk

try-with-resources 中的一个坑,注意避让

Flutter 库冲突问题解决
随机推荐
Implementation of heap sort and quick sort principle
Graduation design of phase 6 of the construction practice camp
cv2导包时报Could not find a version that satisfies the requirement cv2 (from versions: none)
DP problem set
DAO 中常见的投票治理方式
socket(2)
KT6368A蓝牙双模透传芯片软件版本选型说明
You are using pip version 21.1.2; however, version 22.1.2 is available
CV2 package guide times could not find a version that satisfies the requirement CV2 (from versions: none)
磁盘的结构
[notes of wuenda] fundamentals of machine learning
Guava中这些Map的骚操作,让我的代码量减少了50%
关于自动控制原理资料更新
性能测试工具wrk安装使用详解
Raspberry pie preliminary use
How to extract dates from web pages?
Excel布局
如何比较两个或多个分布:从可视化到统计检验的方法总结
Notes on writing questions (18) -- binary tree: common ancestor problem
A girl has been making hardware for ten years. 。。