当前位置:网站首页>Install docker and use docker to install MySQL
Install docker and use docker to install MySQL
2022-07-03 00:16:00 【Horse killing chicken test】
install Docker
1、 Docker Tutorial address :CentOS Docker install | Novice tutorial
2、 install docker
command :
yum install docker-io
3、 start-up docker
command :
service docker start
4、 see docker Startup successful
command :
ps -ef|grep docker

Use docker install mysql
1、 Inquire about mysql
command :
docker search mysql

2、 install mysql
command :
docker pull mysql

3、 Look at the mirror image
command :
docker images

4、 stay opt Create folder
command :
cd /opt/
command :
mkdir mysql_docker
command :
cd mysql_docker/
command :
echo $PWD

5、 start-up mysql Containers , stay var/lib/docker/containers/ Next look at the container
command :
docker run --name mysqlserver -v $PWD/conf:/etc/mysql/conf.d -v $PWD/logs:/logs -v $PWD/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d -i -p 3306:3306 mysql:latest

command :
cd /var/lib/docker/containers/
6、 see mysql process
command :
docker ps -a

7、 Get into mysql Containers , And log in mysql
command :
docker exec -it mysqlserver bash
command :
mysql -uroot -p
8、 Turn on Remote Access
command :
use mysql;
command :
select host,user from user;
command :
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
command :
flush privileges;


Inside the mirror root The user already has remote connection permission inside , So there's no need to set up , It's just that the mode is different that makes it impossible to connect , hold root Change the user's password to mysql_native_password Pattern , You can connect remotely
see docker journal
command :
docker logs -f --tail 10 a4dac74d48f7

Common commands
- Check the process
command :
docker ps -a
- close docker in mysql Containers
command :
docker stop mysqlserver

- restart docker in mysql restart
- restart docker
command :
systemctl restart docker
- close docker
command :
systemctl stop docker
In my hand 10 In a few years of software testing career , Sort out some technical data , Include : e-book , Resume module , Various work templates , Interview treasure , Self study projects, etc . You can scan the code below for free materials or problems in study or work , Add required remarks 【666】
边栏推荐
- 带角度的检测框 | 校准的深度特征用于目标检测(附实现源码)
- How to set automatic reply for mailbox and enterprise mailbox?
- Explain in detail the process of realizing Chinese text classification by CNN
- yolov5test. Py comment
- Talk with the interviewer about the pit of MySQL sorting (including: duplicate data problem in order by limit page)
- Chapter 4 of getting started with MySQL: data types stored in data tables
- Interpretation of new plug-ins | how to enhance authentication capability with forward auth
- JDBC practice cases
- RTP 接发ps流工具改进(二)
- Which software can translate an English paper in its entirety?
猜你喜欢
程序分析与优化 - 9 附录 XLA的缓冲区指派
Request and response
Xcode real machine debugging
Which software can translate an English paper in its entirety?
直击产业落地!飞桨重磅推出业界首个模型选型工具
Custom throttling function six steps to deal with complex requirements
[shutter] shutter open source project reference
Where can I find the English literature of the thesis (except HowNet)?
Optimization of streaming media technology
哪些软件可以整篇翻译英文论文?
随机推荐
Codeforces Round #771 (Div. 2)---A-D
Judge whether the binary tree is full binary tree
有哪些比较推荐的论文翻译软件?
The privatization deployment of SaaS services is the most efficient | cloud efficiency engineer points north
What is the standard format of a 2000-3000 word essay for college students' classroom homework?
How to set automatic reply for mailbox and enterprise mailbox?
[Verilog tutorial]
流媒体技术优化
Xcode real machine debugging
What is the official website address of e-mail? Explanation of the login entry of the official website address of enterprise e-mail
顶级 DevOps 工具链大盘点
接口差异测试——Diffy工具
Realization of mask recognition based on OpenCV
Which websites can I search for references when writing a thesis?
MFC gets the current time
Question e: merged fruit -noip2004tgt2
What are the projects of metauniverse and what are the companies of metauniverse
A single element in an ordered array -- Valentine's Day mental problems
MFC file operation
67 page overall planning and construction plan for a new smart city (download attached)