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

边栏推荐
- The privatization deployment of SaaS services is the most efficient | cloud efficiency engineer points north
- Is the multitasking loss in pytoch added up or backward separately?
- CADD course learning (4) -- obtaining proteins without crystal structure (Swiss model)
- Pytorch里面多任务Loss是加起来还是分别backward?
- Flexible combination of applications is a false proposition that has existed for 40 years
- 35页危化品安全管理平台解决方案2022版
- Bigder:32/100 测试发现的bug开发认为不是bug怎么处理
- Explain in detail the process of realizing Chinese text classification by CNN
- A single element in an ordered array -- Valentine's Day mental problems
- Question e: merged fruit -noip2004tgt2
猜你喜欢

How do educators find foreign language references?
![[Verilog tutorial]](/img/15/d5e188a15e22fa44f1756fc492099d.jpg)
[Verilog tutorial]

哪些软件可以整篇翻译英文论文?

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

Xcode real machine debugging

Create an interactive experience of popular games, and learn about the real-time voice of paileyun unity

開源了 | 文心大模型ERNIE-Tiny輕量化技術,又准又快,效果全開

How to apply for company email when registering in company email format?

130 pages of PPT from the brick boss introduces the new features of Apache spark 3.2 & 3.3 in depth

Where can I find the English literature of the thesis (except HowNet)?
随机推荐
Luogu_ P1149 [noip2008 improvement group] matchstick equation_ Enumeration and tabulation
QT 如何将数据导出成PDF文件(QPdfWriter 使用指南)
实用系列丨免费可商用视频素材库
返回二叉树中最大的二叉搜索子树的根节点
Should you study kubernetes?
maya渔屋建模
Returns the root node of the largest binary search subtree in a binary tree
容器运行时分析
Angled detection frame | calibrated depth feature for target detection (with implementation source code)
开源了 | 文心大模型ERNIE-Tiny轻量化技术,又准又快,效果全开
The privatization deployment of SaaS services is the most efficient | cloud efficiency engineer points north
Sourcetree details
Missing number
leetcode 650. 2 Keys Keyboard 只有两个键的键盘(中等)
How to write the design scheme of the thesis?
Chapter 4 of getting started with MySQL: data types stored in data tables
Improvement of RTP receiving and sending PS stream tool (II)
How QT exports data to PDF files (qpdfwriter User Guide)
zhvoice
Mapper agent development