当前位置:网站首页>Docker installation of MySQL and redis
Docker installation of MySQL and redis
2022-06-11 06:15:00 【Grumpy procedural ape】
centos install docker step
here
start-up docker service
systemctl start docker
Set up docker Boot up
systemctl enable docker
View all mirrors
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
redis latest 7faaec683238 7 months ago 113MB
tomcat 9.0 9427bc9144fa 8 months ago 680MB
nacos/nacos-server latest bdf60dc2ada3 10 months ago 1.05GB
hello-world latest d1165f221234 15 months ago 13.3kB
zookeeper 3.5.7 6bd990489b09 2 years ago 245MB
mysql 5.7.26 e9c354083de7 2 years ago 373MB
redis 3.2 87856cc39862 3 years ago 76MB
Pull mysql5.7 Version image
docker pull mysql:5.7
Running the mirror
docker run --name mysql
-v /mydata/mysql/data:/var/lib/mysql\
-v /mydata/mysql/conf:/etc/mysql\
-v /mydata/mysql/log:/var/log/mysql\
-e MYSQL_ROOT_PASSWORD=root\
-p 3306:3306 -d mysql:5.7
Parameters
-v /mydata/mysql/data:/var/lib/mysql\ Mount the data file to the host : The first one is the destination address of the host : The following is the directory address in the container
-v /mydata/mysql/conf:/etc/mysql\ Mount the configuration file to the host
-v /mydata/mysql/log:/var/log/mysql\ Mount the log file to the host
View the running container
docker ps
[root~]# docker p
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6f2e3327238f mysql:5.7.26 "docker-entrypoint.s…" 6 months ago Exited (0) 6 months ago mysql
Go to interactive mysql in
docker exec -it 6f2e3327238f /bin/bash
modify mysql Configuration file for Set character encoding, etc
vim /mydata/mysql/conf/my.cnf
[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
skip-character-set-client-handshake
skip-name-resolve
restart mysql docker restart mysql
install redis
Pull the mirror image
docker pull redis
start-up redis
Create folder
mkdir -p /mydata/redis/conf
touch /mydata/redis/conf/redis.conf
docker run -p 6379:6379 --name redi -v /mydata/redis/data:/data\
-v /mydata/redis/conf/redis.conf:/etc/redis/redis.conf\
-d redis redis-server /etc/redis/redis.conf --privileged=true
Be careful , The latest version of the command is different , Inside the container conf The location of the file changes to /usr/local/etc/redis/redis.conf
mkdir -p /mydata/redis/conf
touch /mydata/redis/conf/redis.con
Enter into redis Console
docker exec -it redis redis-cli
Turn on redis Persistence
vim /mydata/redis/conf/redis.conf
Join in
bind 0.0.0.0 Open remote permissions
appendonly yes Turn on aof Persistence
restart redis
docker restart redis
边栏推荐
- Cocoatouch framework and building application interface
- Shandong University machine learning experiment 7 pca+ SVM face recognition
- Concepts and differences of parallel computing, distributed computing and cluster (to be updated for beginners)
- [metadata]linkedin datahub
- Growth Diary 01
- Completabilefuture asynchronous task choreography usage and explanation
- FPGA interview notes (III) -- implementation of handshake signal synchronization in cross clock domain, arbitrary frequency division, binary conversion, RAM memory, original code inversion and complem
- Using Internet of things technology to accelerate digital transformation
- Quantitative understanding (Quantitative deep revolutionary networks for effective information: a whitepaper)
- FPGA面试题目笔记(二)——同步异步D触发器、静动态时序分析、分频设计、Retiming
猜你喜欢

Detailed steps for installing mysql-5.6.16 64 bit green version

Free get | full function version of version control software

Record the first data preprocessing process

Moteur de modèle de moteur thymeleaf

Build the first power cloud platform

A collection of problems on improving working frequency and reducing power consumption in FPGA design

Notes sur les questions d'entrevue de la FPGA (IV) - - détecteur de séquence, Code gris dans le domaine de l'horloge croisée, opération de ping - pong, réduction de la perte statique et dynamique, err

MATLAB realizes mean filtering and FPGA for comparison, and uses Modelsim waveform simulation

FPGA设计中提高工作频率及降低功耗题目合集

通过R语言且只用基础package来制作一个小游戏
随机推荐
CCF 2013 12-4 interesting numbers
qmake 实现QT工程pro脚本转vs解决方案
Build the first power cloud platform
This is probably the most comprehensive project about Twitter information crawler search on the Chinese Internet
How to use perforce helix core with CI build server
Sword finger offer 32: print binary tree from top to bottom
FIFO最小深度计算的题目合集
“All in ONE”一个平台解决所有需求,运维监控3.0时代已来
This point of arrow function
做亚马逊测评要了解的知识点有哪些?
Using idea to add, delete, modify and query database
Shuffleerror:error in shuffle in fetcher solution
jenkins-凭证管理
The difference between call and apply and bind
Clear function of ArrayList
Servlet
What do you need to know about Amazon evaluation?
jenkins-不同风格的项目构建
"All in one" is a platform to solve all needs, and the era of operation and maintenance monitoring 3.0 has come
SQLI_ LIBS range construction and 1-10get injection practice