当前位置:网站首页>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 apply for company email when registering in company email format?
- JS interviewer wants to know how much you understand call, apply, bind no regrets series
- Using tensorflow to realize voiceprint recognition
- Use of cocospods
- 监控容器运行时工具Falco
- PR FAQ, what about PR preview video card?
- Digital twin visualization solution digital twin visualization 3D platform
- 1380. Lucky numbers in the matrix
- 大学生课堂作业2000~3000字的小论文,标准格式是什么?
- Analyze ad654: Marketing Analytics
猜你喜欢

95 pages of smart education solutions 2022

maya渔屋建模

JS interviewer wants to know how much you understand call, apply, bind no regrets series

Many to one, one to many processing

How do educators find foreign language references?

实用系列丨免费可商用视频素材库
![Luogu_ P1149 [noip2008 improvement group] matchstick equation_ Enumeration and tabulation](/img/4a/ab732c41ea8a939fa0983fec475622.png)
Luogu_ P1149 [noip2008 improvement group] matchstick equation_ Enumeration and tabulation

Digital twin smart factory develops digital twin factory solutions

What are the recommended thesis translation software?

Mapper agent development
随机推荐
Returns the size of the largest binary search subtree in a binary tree
How to write the design scheme of the thesis?
Maybe you read a fake Tianlong eight
MATLAB signal processing [Q & a notes-1]
CADD课程学习(4)-- 获取没有晶体结构的蛋白(SWISS-Model)
监控容器运行时工具Falco
[shutter] shutter photo wall (center component | wrap component | clickrrect component | stack component | positioned component | button combination component)
开源了 | 文心大模型ERNIE-Tiny轻量化技术,又准又快,效果全开
MySQL advanced learning notes (III)
leetcode 650. 2 Keys Keyboard 只有两个键的键盘(中等)
What are the projects of metauniverse and what are the companies of metauniverse
Explain in detail the process of realizing Chinese text classification by CNN
JDBC tutorial
Difference between NVIDIA n card and amda card
MFC文件操作
写论文可以去哪些网站搜索参考文献?
S12. Verify multi host SSH mutual access script based on key
基于OpenCV实现口罩识别
Realization of mask recognition based on OpenCV
What is the official website address of e-mail? Explanation of the login entry of the official website address of enterprise e-mail