当前位置:网站首页>Docker安装mysql5.7(开启binlog功能、修改字符)
Docker安装mysql5.7(开启binlog功能、修改字符)
2022-06-11 16:58:00 【逆方向的钟197】
跟着官网走。然后我就没啦~ 下面亲测有效
官网:Install Docker Engine on CentOS | Docker Documentation
建议安装前快照一下,不然出错还删不干净,再装还装不上
目录
前提
1.centos7的环境 cat /etc/redhat-release
2.切换成管理员
3.能连的上网 ping www.baidu.com
4.安装c环境
yum -y install gcc
yum -y install gcc-c++安装Docker
1.yum install -y yum-utils
2.yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
ps:第二步很关键,不要用官网的!!!!
3.yum makecache fast
4.yum -y install docker-ce docker-ce-cli containerd.io
5.systemctl start docker 启动docker
6.systemctl enable docker 开机启动
docker | Docker Documentation ps:常用命令
切换阿里镜像
去阿里官网注册然后搜索,就可以直接用
直接去搜镜像加速器

安装mysql
1.创建容器卷路径
因为要配置容器卷,提前把配置文件创好
mkdir -p /mydata/mysql/log
mkdir -p /mydata/mysql/data
mkdir -p /mydata/mysql/conf2.下载镜像
去docker hub搜索镜像Docker Hub
docker pull mysql:5.7

docker pull mysql:5.7
docker run -p 3306:3306 --name mysql \
-v /mydata/mysql/log:/var/log/mysql \
-v /mydata/mysql/data:/var/lib/mysql \
-v /mydata/mysql/conf:/etc/mysql \
-e MYSQL_ROOT_PASSWORD=123456\
-d mysql:5.73.修改配置文件
修改mysql配置文件
[client]
default_character_set=utf8
[mysqld]
log-bin=/var/lib/mysql/mysql-bin
server-id=123654
expire_logs_days = 30
collation_server = utf8_general_ci
character_set_server = utf8
vi /mydata/mysql/conf/my.conf
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
init_connect=‘SET collation_connection = utf8_unicode_ci’
init_connect=‘SET NAMES utf8’
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
skip-name-resolve
4.检查
修改完之后记得重启
docker restart mysql
修改成功
SHOW VARIABLES LIKE 'character%';
show variables like '%log_bin%';

实操
按照是上面代码的顺序
查看网络

安装c环境




边栏推荐
- (验证文件)validateJarFile...报错
- Student website template brown cake dessert website design - brown cake dessert shop (4 pages) gourmet dessert website production final assignment finished product_ Fresh fruit web design final assign
- [Clickhouse column] create a new library, user and role
- RSP: An Empirical Study of remote sensing pre training
- Database backup (MySQL)
- Meituan won the first place in fewclue in the small sample learning list! Prompt learning+ self training practice
- 7 life tools: SWOT, PDCA, 6w2h, smart, WBS, time management, and the 28 principles
- VLAN partition and routing between VLANs
- pycharm和anaconda的基础上解决Jupyter连接不上Kernel(内核)的问题--解决方案1
- Elasitcsearch basic learning notes (1)
猜你喜欢

Simulated 100 questions and simulated examination for main principals of hazardous chemical business units in 2022

Opencv相机标定之圆形标识点中心检测

pycharm和anaconda的基础上解决Jupyter连接不上Kernel(内核)的问题--解决方案1

2022G1工业锅炉司炉考题及模拟考试

2022 national question bank and mock examination for safety officer-b certificate

一套ThinkPHP微信小程序商城源码带后台管理

消息队列-推/拉模式学习 & ActiveMQ及JMS学习

A journey of database full SQL analysis and audit system performance optimization

Tornado environment construction and basic framework construction -- familiar Hello World

The micro service failed to connect to the cloud sentinel console and the link blank problem occurred after the connection was successful (resolved)
随机推荐
Katalon Studio Enterprise
Persistence mechanism of redis
seed-emulator下进行sql注入攻击(含sql环境配置)
Using MATLAB and dcraw to process digital camera raw files
网络流媒体协议的联系与区别(RTP RTCP RTSP RTMP HLS)
Redis --- 学习 NoSQL 五大类型
Real time myth -- real-time RTOS multitask performance analysis
ASP. Net education OA system source code education industry OA system source code with document
Report on the operation situation and future prospects of China's gear oil industry (2022-2028)
Solr (II) Solr adds core and dependent package path
VLAN partition and routing between VLANs
Classic reading of multi task learning: MMOE model
启牛推荐开通的股票账户安全吗?靠谱吗
基于udp端口猜测的内网穿透
tornado环境搭建及基本框架搭建——熟悉的hello world
“is-a”,“has-a”,“like-a”
Science popularization genius on the left, madman on the right
LeetCode——42. 接雨水(双指针)
[Clickhouse column] create a new library, user and role
ShellBrowser .NET Crack