当前位置:网站首页>Docker deployment MySQL 8
Docker deployment MySQL 8
2022-07-01 01:18:00 【linmengmeng_ one thousand three hundred and fourteen】
Docker Deploy MySQL 8
1. Pull the mirror image
Go directly to dockerhub Just go , Find the image version you want :https://hub.docker.com/_/mysql
Pull the mirror image :docker pull mysql:8
I'm going to use it directly here 8 , Then use the above command , If you choose another tag, Replace it directly .
2. Start the container and mount the directory
docker run --restart always \
--name mysql8 \
-p 3307:3306 \
-p 33070:33060 \
-v /usr/soft/mysql-3307/mysql-files:/var/lib/mysql-files \
-v /usr/soft/mysql-3307/data:/var/lib/mysql \
-v /usr/soft/mysql-3307/conf.d:/etc/mysql/conf.d \
-v /usr/soft/mysql-3307/etc.mysql:/etc/mysql \
-e MYSQL_ROOT_PASSWORD= abc23456\
-d mysql:8 \
--character-set-server=utf8mb4 \
--collation-server=utf8mb4_general_ci \
--default_authentication_plugin=mysql_native_password
here -e MYSQL_ROOT_PASSWORD Direct designation root password :abc23456
abnormal
1. Unmounted directory /var/lib/mysql-files
Error message :
Failed to access directory for --secure-file-priv. Please make sure that directory exists and is accessible by MySQL Server. Supplied value : /var/lib/mysql-files
When the container is started , Add mount directory :-v /usr/soft/mysql-3307/mysql-files:/var/lib/mysql-files
2. Navicat Connection error :2059-Authentication plugin caching_sha2_password cannot be load…
Configure the container with parameters :--default_authentication_plugin=mysql_native_password
At the end of the command to start the container , Add this parameter .
After this change , Although it can start normally , But look at the log , There's a reminder :
2022-06-28T10:01:24.463764Z 0 [Warning] [MY-010101] [Server] Insecure configuration for --secure-file-priv: Location is accessible to all OS users. Consider choosing a different directory.
2022-06-28T10:01:24.463859Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-06-28T10:01:24.463892Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.29) starting as process 1
2022-06-28T10:01:24.465571Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2022-06-28T10:01:24.465595Z 0 [Warning] [MY-013244] [Server] --collation-server: 'utf8_general_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
2022-06-28T10:01:24.473710Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
You can see Tip... Is not recommended , This can be changed to :
--character-set-server=utf8mb4 \
--collation-server=utf8mb4_general_ci \
边栏推荐
- Pytorch installs and uses GPU acceleration
- P4 learning - Basic tunneling
- Problem solving: how to manage thread_local pointer variables
- Xjy-220/43ac220v static signal relay
- A letter to 5000 fans!
- 机器人编程的培训学科类原理
- The real topic of the 11th provincial competition of Bluebridge cup 2020 - crop hybridization
- Exercise and health
- 对libco的一点看法
- ORB-SLAM2源码学习(二)地图初始化
猜你喜欢

Practical shell knowledge

解析融合学科本质的创客教育路径

Chapter 53 overall understanding of procedures from the perspective of business logic implementation

二十多年来第一次!CVPR最佳学生论文授予中国高校学生!

Set different background colors for the border and text of the button

P4 learning - Basic tunneling

Get to know the drawing component of flutter - custompaint

C#生成putty格式的ppk文件(支持passphrase)

Orb-slam2 source code learning (II) map initialization

Technical personnel advanced to draw a big picture of business, hand-in-hand teaching is coming
随机推荐
[2023 MediaTek approved the test questions in advance] ~ questions and reference answers
ORB-SLAM2源码学习(二)地图初始化
Implementation of date class
How to do the performance pressure test of "Health Code"
Error msb8031: building an MFC project for a non Unicode character set is deprecated
A proper job is a good job
Analyzing the wisdom principle in maker education practice
Usage of C set
Double position relay dls-5/2 dc220v
What if the disk of datanode is full?
DX-11Q信号继电器
Detailed analysis of operators i++ and ++i in JS, i++ and ++i
C#生成putty格式的ppk文件(支持passphrase)
Two-stage RO: part 1
Chapter 53 overall understanding of procedures from the perspective of business logic implementation
解析融合学科本质的创客教育路径
【学习笔记】倍增 + 二分
Inspire students' diversified thinking with steam Education
Packing and unpacking of C #
解析创客教育实践中的智慧原理