当前位置:网站首页>Install MySQL based on docker
Install MySQL based on docker
2022-07-28 10:48:00 【Quiet Xiao Zhang】
Catalog
3. Create from mirror mysql Containers
4. Enter the container and test mysql Whether to create successfully
1. Check out the MySQL
# docker search mysql
dockerhub Address Docker Hub
2. Pull MySQL Mirror image
# docker pull mysql
[[email protected] ~]# docker pull mysql Using default tag: latest latest: Pulling from library/mysql Digest: sha256:6d7d4524463fe6e2b893ffc2b89543c81dec7ef82fb2020a1b27606666464d87 Status: Image is up to date for mysql:latest docker.io/library/mysql:latest [[email protected] ~]#
3. Create from mirror mysql Containers
docker run -itd --name mysql --restart always --privileged=true \ -v /daya/mysql/conf:/etc/mysql/conf.d \
-v /data/mysql/data:/var/lib/mysql \
-v /data/mysql/logs:/var/log \
-p 3306:3306 -e MYSQL_ROOT_PASSWORD=admin \
mysql --character-set-server=utf8 --collation-server=utf8_general_ci
[[email protected] ~]# docker run -itd --name mysql --restart always --privileged=true \
-v /daya/mysql/conf:/etc/mysql/conf.d \
-v /data/mysql/data:/var/lib/mysql \
-v /data/mysql/logs:/var/log \
-p 3306:3306 -e MYSQL_ROOT_PASSWORD=admin \
mysql --character-set-server=utf8 --collation-server=utf8_general_ci
6ffd0507b1b1dcec967ccb7df4fbb077021c2dea9857e5e122fdc0df6d36a0e5
[[email protected] ~]# -e MYSQL_ROOT_PASSWORD=admin Set database password
--character-set-server=utf8 --collation-server=utf8_general_ci Set the encoding format
4. Enter the container and test mysql Whether to create successfully
# j Enter the inside of the container
docker exec -it mysql /bin/bash
# Connect mysql
mysql -uroot -p
[[email protected] ~]# docker exec -it mysql /bin/bash
[email protected]:/# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 148
Server version: 8.0.27 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
mysql> You can also use Navicat Tools to connect
边栏推荐
猜你喜欢

8、Yarn系统架构与原理详解

GKSpheresNoiseSource

Product side data analysis thinking

11_ UE4 advanced_ Change male characters to female characters and modify the animation

7. MapReduce custom sorting implementation

GKConstantNoiseSource

机器人技术(RoboCup 2D)如何进行一场球赛

蓝桥杯嵌入式-HAL库-USART_RX

3、MapReduce详解与源码分析

Qt生成.exe文件 并 在无Qt环境下运行(Enigma Virtual Box进行绿色可执行软件封装)图文教程
随机推荐
蓝桥杯嵌入式-HAL库-ADC
安装office自定义项 安装期间出错 解决办法
20200217 training match L1 - 7 2019 is coming (20 points)
The 11th Blue Bridge Cup Undergraduate group competition (20200321)
GKPolygonObstacle
SemEval 2022 | 将知识引入NER系统,阿里达摩院获最佳论文奖
第11届蓝桥杯本科组校赛(20200321)
Codeforces Round #614 (Div. 2) B. JOE is on TV!
GKCircleObstacle
Tensorflow knowledge points
ACM winter vacation training 4
11_ UE4 advanced_ Change male characters to female characters and modify the animation
GKRandomSource
GKConstantNoiseSource
GKLinearCongruentialRandomSource
GKRandomSource
5. Implement MapReduce program on window side to complete wordcount function
Configuring raspberry pie, process and problems encountered
GKPolygonObstacle
两年CRUD,二本毕业,备战两个月面试阿里,侥幸拿下offer定级P6