当前位置:网站首页>Docker installing MySQL
Docker installing MySQL
2022-06-11 20:33:00 【cpuCode】
Docker install MySQL
docker operation
https://blog.csdn.net/qq_44226094/article/details/120624387
install MySQL
Pull MySQL
sudo docker pull mysql:5.7
function MySQL
- –name Specify container name
- -v Directory mount
- -p Specify port mapping , The container of 3306 Port mapping to host's 3306 port
- -e Set up mysql Parameters MYSQL_ROOT_PASSWORD : initialization root The user's password is
- -d Background operation
sudo 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=cpucode \
-d mysql:5.7
Get into MySQL
docker exec -it mysql bin/bash
sign out
exit
Because there are directory mappings , So we can execute directly outside the image
vim Modify the configuration file
vim /mydata/mysql/conf/my.conf

Set up MySQL Parameters
[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
Dokcer restart MySQL service
docker restart mysql

Set up along with docker Start autorun
docker update mysql --restart=always

边栏推荐
- 输入值“18-20000hz”错误,设置信息不完整,请选择单位
- Detailed explanation on persistence of 2022redis7.0x
- Explanation of LNMP architecture source code compilation and installation with pictures and texts (with forum experiment)
- STL container nested container
- R 16 basic exercises
- 13 r basic exercises
- In unity, opencv and QT are used to create a plugin (I)
- What is the essence and process of SCM development? Chengdu Automation Development Undertaking
- "Video version Mae" of hekaiming team, efficient video pre training! The effect is also very good when mask ratio is up to 90
- 模拟Oracle锁等待与手工解锁
猜你喜欢

周刊02|不瞒你说,我其实是MIT的学生

29. location對象
Recompile kubeadm to solve the problem of certificate expiration in one year

Tensorflow --- creation and reading of tfrecord file

In 2021, the global ceramic substrate revenue will be about US $409.7 million, and it is expected to reach US $657.3 million in 2028

Unity package manager starting server stuck

2022Redis7.0x版本持久化详细讲解

ICML 2022 | 基于结构化数据的异常检测再思考:我们究竟需要怎样的图神经网络?...

The latest test questions and answers for the eight major members (standard members) of Ningxia architecture in 2022

周鸿祎:想做直播带货抹不下面子 数据勒索成突出的安全威胁
随机推荐
Web3 product manager guide - Jason
Rtd2171u, substitute for trd2171u, substitute for trd2171u, cs5261 C to hdmi4k_ 30Hz
输入值“18-20000hz”错误,设置信息不完整,请选择单位
Two minutes to show you the charging standard of the Sub Ledger System
使用flask框架写挡板
Usage methods and cases of PLSQL blocks, cursors, functions, stored procedures and triggers of Oracle Database
桌面以及文件资源管理器无限重启的解决
黑圆圈显示实现
模拟Oracle锁等待与手工解锁
27. this指向问题
VS2010 cannot open when linking sql2008 database
29. location对象
In 2021, the global revenue of flexible fireproof sealant is about 755.2 million dollars, and it is expected to reach 1211.7 million dollars in 2028
2022-2028 global and Chinese thermocouple sensor market status and future development trend
上海内推 | 上海期智研究院于洋老师课题组招收全职研究员
In unity, opencv and QT are used to create a plugin (I)
Recompile kubeadm to solve the problem of certificate expiration in one year
Capriccio in the Internet Age
STL container nested container
Show your creativity and win the graphics card! Mmpose attitude estimation creative contest shocks