当前位置:网站首页>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
边栏推荐
- GKCoherentNoiseSource
- Idea create my first project
- Inside story of Wu xiongang being dismissed by arm: did the establishment of a private investment company harm the interests of shareholders?
- Can kingbasees v8r6 JDBC use VIP?
- Django celery redis send email asynchronously
- markdown转成word或者pdf
- ACM winter vacation training 4
- 试题 历届试题 发现环
- RoboCup (2D) experiment 50 questions and the meaning of main functions
- samba学习
猜你喜欢

Excel word simple skills sorting (continuous update ~)

蓝桥杯电子类嵌入式第十届省赛

GKCheckerboardNoiseSource

Shortest path topic

Chapter 1: cross end development of small programs of uniapp ----- create a uniapp project
Advanced C language: pointer (1)

GKConstantNoiseSource

PyQt5快速开发与实战 4.12 日历与时间

蓝桥杯嵌入式-HAL库-LCD

GKCylindersNoiseSource
随机推荐
SQL Server 2016 learning records - single table query
GKNoise
I don't know how lucky the boy who randomly typed logs is. There must be a lot of overtime
GKSphereObstacle
GKCircleObstacle
Tensorflow knowledge points
c语言进阶篇:指针(一)
AP Autosar平台设计 3架构
GKVoronoiNoiseSource
Machine learning -- handwritten English alphabet 3 -- engineering features
GKSpheresNoiseSource
两年CRUD,二本毕业,备战两个月面试阿里,侥幸拿下offer定级P6
Codeforces Round #614 (Div. 2) B. JOE is on TV!
8、Yarn系统架构与原理详解
AP Autosar平台设计 1-2 导言、技术范围与方法
samba学习
Start from scratch blazor server (2) -- consolidate databases
Andorid development III (intent)
RoboCup (2D) experiment 50 questions and the meaning of main functions
GKNoiseMap