当前位置:网站首页>docker修改mysql配置文件
docker修改mysql配置文件
2022-08-08 06:20:00 【wuyongde0922】
docker下修改mysql配置文件
1.找到mysql镜像
docker ps
2.进入镜像mysql镜像内部
docker exec -it aa3dc8547da1 /bin/bash
3.安装vim
因为docker镜像内部没有带vim命令,所以需要手动安装,也可以利用docker cp命令从宿主机中复制过去
apt-get update
apt-get install vim
4.编辑配置文件
vim /etc/mysql/mysql.conf.d/mysqld.cnf

在文件中加入max_connections=1024保存退出
5.重启镜像
docker kill aa3dc8547da1
docker start aa3dc8547da1
6.查看mysql连接数是否改变
进入mysql容器,并登录mysql
1)docker exec -it aa3dc8547da1 bash,mysqldocker容器名称
2)mysql -uroot -p,接着输入密码123456(创建容器的时设置的),如下成功了
show variables like '%max_connections%';
边栏推荐
猜你喜欢

flex布局缺点

研发医疗器械产品需要做的测试

How many times the neural network is generally trained, the neural network training time is too long

How to batch import files and rename them all to the same file name

【MySQL】——事务的基本概念

教你六步拆解 DDD领域驱动设计落地实践

【ESP8266】ESP12S/12F 最小系统设计及typeC自动下载电路设计

webstorage

The tests that need to be done in the development of medical device products

基本工具-NETCAT(telnet-banner、传输文本信息)
随机推荐
Completed - desktop interactive wizard design based on facial expressions (share the results, attach the data set of facial expressions and the yolov5 model trained by yourself and the interactive int
torch.gather() 用法解读
cs软件ui构建办法
基本工具-NETCAT(telnet-banner、传输文本信息)
Summary of digital IC design written test questions (4): some basic knowledge points
人体神经元细胞分布图片,神经元人体分布大图
验证的计划
"Public Administration" exam key points and answers
字符串题目解析
Postman显示验证码图片(base64字符串)
Typescript namespace
仿QQ好友列表,QListWidget!
How to batch import files and rename them all to the same file name
MySQL5
仿记事本;QFile
Rust学习:4_基本类型
PAT乙级-B1029 旧键盘(20)
stack-queue
Web Application Vulnerability Assessment with Zap and W3af
代码自动初始化