当前位置:网站首页>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】
边栏推荐
- Maybe you read a fake Tianlong eight
- How QT exports data to PDF files (qpdfwriter User Guide)
- Which software can translate an English paper in its entirety?
- Digital collection trading website domestic digital collection trading platform
- 大学生课堂作业2000~3000字的小论文,标准格式是什么?
- Improvement of RTP receiving and sending PS stream tool (II)
- Explain in detail the process of realizing Chinese text classification by CNN
- Luogu_ P2010 [noip2016 popularization group] reply date_ Half enumeration
- TypeError: Cannot read properties of undefined (reading ***)
- Missing number
猜你喜欢
哪些软件可以整篇翻译英文论文?
CADD课程学习(4)-- 获取没有晶体结构的蛋白(SWISS-Model)
洛谷_P1149 [NOIP2008 提高组] 火柴棒等式_枚举打表
MySQL基础
Architecture: database architecture design
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
Chapter 3 of getting started with MySQL: database creation and operation
In February 2022, the ranking list of domestic databases: oceanbase regained its popularity with "three consecutive increases", and gaussdb is expected to achieve the largest increase this month
Hit the industry directly! The propeller launched the industry's first model selection tool
随机推荐
Should you study kubernetes?
Slf4j + Logback日志框架
Digital twin smart factory develops digital twin factory solutions
Question e: merged fruit -noip2004tgt2
Codeforces Round #771 (Div. 2)---A-D
Linux 下安装 redis
返回二叉树中最大的二叉搜索子树的根节点
Leetcode DP three step problem
Happy Lantern Festival, how many of these technical lantern riddles can you guess correctly?
JDBC練習案例
返回二叉树中最大的二叉搜索子树的大小
Analyze ad654: Marketing Analytics
[shutter] shutter photo wall (center component | wrap component | clickrrect component | stack component | positioned component | button combination component)
大学生课堂作业2000~3000字的小论文,标准格式是什么?
How to set automatic reply for mailbox and enterprise mailbox?
Bean load control
95页智慧教育解决方案2022
1380. Lucky numbers in the matrix
Where can I find foreign papers?
leetcode 650. 2 Keys Keyboard 只有两个键的键盘(中等)