当前位置:网站首页>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】

边栏推荐
猜你喜欢

Difference between NVIDIA n card and amda card

Additional: token; (don't read until you finish writing...)

Realization of mask recognition based on OpenCV

How much do you know about synchronized?

Dishes launcher small green program and directory management (efficiency tool)

Which websites can I search for references when writing a thesis?

RTP 接发ps流工具改进(二)

程序分析与优化 - 9 附录 XLA的缓冲区指派

What is the official website address of e-mail? Explanation of the login entry of the official website address of enterprise e-mail

Improvement of RTP receiving and sending PS stream tool (II)
随机推荐
Bean load control
Develop knowledge points
Interface automation coverage statistics - used by Jacobo
英文论文有具体的格式吗?
zhvoice
Which websites can I search for references when writing a thesis?
What website can you find English literature on?
洛谷_P2010 [NOIP2016 普及组] 回文日期_折半枚举
请问大家在什么网站上能查到英文文献?
How to write the design scheme of the thesis?
Slf4j + Logback日志框架
Returns the root node of the largest binary search subtree in a binary tree
顶级 DevOps 工具链大盘点
Hit the industry directly! The propeller launched the industry's first model selection tool
130 pages of PPT from the brick boss introduces the new features of Apache spark 3.2 & 3.3 in depth
论文的设计方案咋写?
MATLAB signal processing [Q & a notes-1]
返回二叉树中最大的二叉搜索子树的根节点
Explain in detail the process of realizing Chinese text classification by CNN
sourcetree 详细