当前位置:网站首页>第三篇:docker安装mysql容器(自定义端口)
第三篇:docker安装mysql容器(自定义端口)
2022-04-23 06:05:00 【大林子先森】
第一步:下载镜像
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=root \ -d mysql:5.7
第三步:进入mysql容器的命令行界面
docker exec -it mysql /bin/bash
第四步:登录mysql
mysql -u root -p
第五步: 配置
[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
第六步:设置开机启动mysql
docker update mysql --restart=always
第七步:关闭开机启动mysql
docker update mysql --restart=no
版权声明
本文为[大林子先森]所创,转载请带上原文链接,感谢
https://blog.csdn.net/liulianglin/article/details/122106151
边栏推荐
- Research on alertmanager repeated / missing alarm phenomenon and two key parameters_ Wait and group_ Interpretation of interval
- 个人学习相关
- 开篇:双指针仪表盘的识别
- Kubernetes CoreDNS常见问题资料参考
- 冬季实战营 动手实战-初识上云基础,动手实操ECS云服务器新手上路 领鼠标 云小宝 背包 无影
- 常用于融合去重的窗口函数row_number
- 异常记录-18
- Redis practice notes and source code analysis
- Chaos带你快速上手混沌工程
- Prometheus thanos Quick Guide
猜你喜欢

Typical application scenarios of alicloud log service SLS

Redis practice notes and source code analysis

Memcached source code analysis

冬季实战营动手实战-上云必备环境准备,动手实操快速搭建LAMP环境 领鼠标 云小宝 背包 无影

Prometheus Thanos快速指南

Chaos帶你快速上手混沌工程

Introduction to common APIs for EBFP programming

Prometheus Cortex使用Block存储时的相关问题

基於ECS搭建雲上博客(雲小寶碼上送祝福,免費抽iphone13任務詳解)

Build a cloud blog based on ECS (send blessings on the cloud Xiaobao code and draw iphone13 for free)
随机推荐
Chaos帶你快速上手混沌工程
Build a cloud blog based on ECS (send blessings on the cloud Xiaobao code and draw iphone13 for free)
oracle用delete删除数据所需时间测试
qs. In the stringify interface, the input parameter is converted into a & connected string (with the application / x-www-form-urlencoded request header)
阿里矢量库的图标使用教程(在线,下载)
双指针仪表盘读数(一)
Dolphinscheduler集成Flink任务踩坑记录
通过rownum来进行区间查询
Abnormal record-16
Dolphinscheduler配置Datax踩坑记录
Implementation of multi tenant read and write in Prometheus cortex
解决:You have 18 unapplied migration(s). Your project may not work properly until you apply
常用于融合去重的窗口函数row_number
oracle计算两日期相差多少秒,分钟,小时,天
Thanos如何为不同租户配置不同的数据保留时长
Apache Atlas 编译及安装记录
Abnormal record-21
BCC installation and basic tool instructions
How does thanos configure different data retention durations for different tenants
oracle表的约束详解