当前位置:网站首页>第三篇: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
边栏推荐
猜你喜欢
Ali vector library Icon tutorial (online, download)
Prometheus Thanos快速指南
ACFS文件系统创建扩大缩小等配置步骤
Oracle Job定时任务的使用详解
Prometheus cortex Architecture Overview (horizontally scalable, highly available, multi tenant, long-term storage)
开篇:双指针仪表盘的识别
10g数据库使用大内存主机时不能启动的问题
实践使用PolarDB和ECS搭建门户网站
Introduction to RDMA network
Prometheus的relabel_configs和metric_relabel_configs解释及用法示例
随机推荐
mysql和pg库遇到冲突数据时的两种处理方式
Prometheus Cortex使用Block存储时的相关问题
微服务架构核心概念
oracle计算两日期相差多少秒,分钟,小时,天
实践使用PolarDB和ECS搭建门户网站
RAC环境报错ORA-00239: timeout waiting for control file enqueue排查
RAC环境集群组件gpnp未启动成功问题分析
oracle表空间表分区详解及oracle表分区查询使用方法
Exception record-14
JS 比较2个数组中不同的元素
oracle存储过程中is和as区别
Winter combat camp hands-on combat - first understand the cloud foundation, hands-on practice ECS ECS ECS novice on the road to get the mouse cloud Xiaobao backpack shadowless
js 函数包裹forEach中使用return跳不出外层函数
Information:2021/9/29 10:01 - Build completed with 1 error and 0 warnings in 11s 30ms Error异常处理
How does thanos configure different data retention durations for different tenants
异常记录-15
基於ECS搭建雲上博客(雲小寶碼上送祝福,免費抽iphone13任務詳解)
异常记录-13
Exception record-5
专用窗口函数rank, dense_rank, row_number