当前位置:网站首页>Implementation steps of docker deploying mysql8
Implementation steps of docker deploying mysql8
2022-07-07 03:44:00 【1024 questions】
One 、 Pre demand
Two 、 Deployment method
3、 ... and 、 Access test
One 、 Pre demand1.linux System
I use the Centos7
2. install docker
Refer to this article
Two 、 Deployment method1. Pull mysql8 Mirror image
docker pull mysql:8
2. Create profile mount directory and data mount directory
mkdir -p /usr/mysql/conf /usr/mysql/datachmod -R 755 /usr/mysql/ps:
/home/mysql/config: discharge mysql The configuration file my.conf
/home/mysql/data: discharge mysql data
3. create profile
vim /usr/mysql/conf/my.cnfThe contents are as follows
[client]#socket = /usr/mysql/mysqld.sockdefault-character-set = utf8mb4[mysqld]#pid-file = /var/run/mysqld/mysqld.pid#socket = /var/run/mysqld/mysqld.sock#datadir = /var/lib/mysql#socket = /usr/mysql/mysqld.sock#pid-file = /usr/mysql/mysqld.piddatadir = /usr/mysql/datacharacter_set_server = utf8mb4collation_server = utf8mb4_binsecure-file-priv= NULL# Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-links=0# Custom config should go here!includedir /etc/mysql/conf.d/4. Start the container and mount the directory
docker run --name mysql8 --restart=always -v /usr/mysql/conf/my.cnf:/etc/mysql/my.cnf -v /usr/mysql/data:/var/lib/mysql -v /etc/localtime:/etc/localtime:ro -p 4706:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql:8ps:
-v /usr/mysql/conf/my.cnf:/etc/mysql/my.cnf Native MySQL The configuration file is mapped to the container MySQL The configuration file
-v /etc/localtime:/etc/localtime:ro The local time is synchronized with the database time
–restart=always When restarting Docker The container will be started automatically
-d : Background operation
-p Port mapping Host port number : Container port number
-e Environmental parameters ,MYSQL_ROOT_PASSWORD Set up root User's password
docker run -p 60306:3306 -e MYSQL_ROOT_PASSWORD=123 -v /etc/my.cnf:/etc/mysql/my.cnf:rw -v /etc/localtime:/etc/localtime:ro --name mysql8 --restart=always -dit mysql
5. Get into mysql Create user
<1> Into the container
docker exec -it mysql8 /bin/bash<2> Get into mysql
mysql -uroot -p123456<3> Create user
I'll create one here called python Users of
# establish python user , The password for 123456, Allow login on any machine CREATE USER 'python'@'%' IDENTIFIED BY '123456';<4> To give permission
# give python The user is in On all machines Yes All databases and data tables Have All operation rights GRANT ALL ON *.* TO 'python'@'%'; 3、 ... and 、 Access test 

Successful connection
This is about Docker Deploy Mysql8 This is the end of the article on the implementation steps of , More about Docker Deploy Mysql8 Please search the previous articles of software development network or continue to browse the relevant articles below. I hope you will support software development network more in the future !
边栏推荐
- Delete data in SQL
- Construction of Hisilicon universal platform: color space conversion YUV2RGB
- 复杂因子计算优化案例:深度不平衡、买卖压力指标、波动率计算
- CMB's written test - quantitative relationship
- Mobile measurement and depth link platform - Branch
- The latest 2022 review of "small sample deep learning image recognition"
- 浅谈网络安全之文件上传
- Clock in during winter vacation
- Numpy中排序操作partition,argpartition,sort,argsort
- 装饰设计企业网站管理系统源码(含手机版源码)
猜你喜欢

如何替换模型的骨干网络(backbone)

22. (ArcGIS API for JS) ArcGIS API for JS Circle Collection (sketchviewmodel)

API data interface of A-share index component data

Principle of attention mechanism

树莓派设置静态ip

20.(arcgis api for js篇)arcgis api for js面采集(SketchViewModel)

Set static IP for raspberry pie

Optimization cases of complex factor calculation: deep imbalance, buying and selling pressure index, volatility calculation

Under the tide of "going from virtual to real", Baidu AI Cloud is born from real

24.(arcgis api for js篇)arcgis api for js点修改点编辑(SketchViewModel)
随机推荐
QT thread and other 01 concepts
Sorting operation partition, argpartition, sort, argsort in numpy
[security attack and Defense] how much do you know about serialization and deserialization?
Flink task exit process and failover mechanism
23.(arcgis api for js篇)arcgis api for js椭圆采集(SketchViewModel)
Shell programming basics
概率论公式
2022年上半年HIT行业TOP50
2022.6.28
亚像素级角点检测Opencv-cornerSubPix
CMB's written test - quantitative relationship
装饰设计企业网站管理系统源码(含手机版源码)
【安全攻防】序列化與反序列,你了解多少?
编译常量、ClassLoader类、系统类加载器深度探析
Ubuntu20 installation redisjson record
codeforces每日5题(均1700)-第七天
Experience design details
QT 项目 表格新建列名称设置 需求练习(找数组消失的数字、最大值)
哈夫曼树基本概念
Sub pixel corner detection opencv cornersubpix