当前位置:网站首页>Docker install MySQL
Docker install MySQL
2022-06-13 01:17:00 【A simple heart】
1. Use docker install mysql
a. Search database mirroring
[[email protected]]# docker search mysql
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
mysql MySQL is a widely used, open-source relation… 10480 [OK]
mariadb MariaDB is a community-developed fork of MyS… 3898 [OK]
mysql/mysql-server Optimized MySQL Server Docker images. Create… 769 [OK]
percona Percona Server is a fork of the MySQL relati… 526 [OK]
b. install mysql, Pull it mysql Mirror image , The corresponding version can be pulled according to the actual use . Default latest version .
[[email protected]]# docker pull mysql:5.7
c. Start database ( The port can be specified by command , You can also customize the corresponding configuration information )
[[email protected]]# docker run --name mysql -v /data/mysql/conf/my.cnf:/etc/mysql/my.cnf -v /data/mysql/data:/var/lib/mysql -v /data/mysql/log:/var/log/mysql -e MYSQL_ROOT_PASSWORD=*** --privileged=true --network host -d mysql:5.7
–name: Specify the container name .
-v: Specify the mount Directory ( Local directory ( On their own : To configure ): Mapping directory )
-e: Specify the initialization password
–privileged=true: Specify some permissions
–network : To develop ip
-d: Indicates that the container is running in the background
d. View running status , as follows status by Up In operation
[[email protected]]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
sh64r2f22968 mysql:5.7 "docker-entrypoint.s…" 42 minutes ago Up 15 minutes mysql
e. Link usage
[[email protected]]# docker exec -it CONTAINER_ID /bin/bash // Into the container , Accessing the database , Otherwise, we can't access it .
f. After logging in the data path , Reset password ,
mysql>update user set authentication_string=password("***") where user="user_name";
notes :5.7 after mysql There is no password Field , More for authentication_string.
install redis similar , Just refer to .
边栏推荐
- Characteristics of transactions - persistence (implementation principle)
- Remove duplicates from an ordered array
- Pipeline流水线项目构建
- 707. design linked list
- Leetcode question brushing 04 string
- [projet cs144 de Stanford Computing Network] lab1: Stream reassembler
- Polymorphism and virtual function
- Unity extension
- leetcode 142. Circular linked list II
- Key point detection data preparation and model design based on u-net Network -- detection model of four key points of industrial components
猜你喜欢

Pipeline流水线项目构建

4K sea bottom and water surface fabrication method and ocean bump displacement texture Download
![[003] embedded learning: creating project templates - using stm32cubemx](/img/18/43dfa98f1711e8e544828453e36812.jpg)
[003] embedded learning: creating project templates - using stm32cubemx

Leetcode question brushing 06 bit operation

sort

Deadlock problem summary

Traditional machine learning classification model predicts the rise and fall of stock prices under more than 40 indicators

How does Apple add QQ email?

Et5.0 configuring Excel

Leetcode question brushing 03 stack
随机推荐
Leetcode-12- integer to Roman numeral (medium)
Leetcode-78- subset (medium)
Leetcode-11- container with the most water (medium)
3623. Merge two ordered arrays
Jenkins continuous integration operation
Wal mechanism of MySQL
MySQL index
Continue when the condition is not asked, execute the parameter you compare
Wangdao machine test - Chapter 6 - maximum common divisor GCD and minimum common multiple LCM
leetode. 242. valid Letter heteronyms
How to choose stocks? Which indicator strategy is reliable? Quantitative analysis and comparison of strategic returns of vrsi, bbiboll, WR, bias and RSI indicators
Unity extension
Leetcode question brushing 04 string
Method of cleaning C disk
Vector|hdu-4841 round table questions
A problem discovery and attempted solution to the strange stop of server script
【斯坦福計網CS144項目】Lab1: StreamReassembler
Leetcode-18- sum of four numbers (medium)
Self use notes for problem brushing learning
工作与生活