当前位置:网站首页>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 write the design scheme of the thesis?
- Chinatelecom has maintained a strong momentum in the mobile phone user market, but China Mobile has opened a new track
- JDBC tutorial
- Improvement of RTP receiving and sending PS stream tool (II)
- S12. Verify multi host SSH mutual access script based on key
- JDBC Exercise case
- JS interviewer wants to know how much you understand call, apply, bind no regrets series
- List of major chip Enterprises
- How to specify const array in the global scope of rust- How to specify const array in global scope in Rust?
- Using tensorflow to realize voiceprint recognition
猜你喜欢

来自数砖大佬的 130页 PPT 深入介绍 Apache Spark 3.2 & 3.3 新功能

The privatization deployment of SaaS services is the most efficient | cloud efficiency engineer points north

Interpretation of new plug-ins | how to enhance authentication capability with forward auth

容器运行时分析
![Luogu_ P2010 [noip2016 popularization group] reply date_ Half enumeration](/img/a3/55bb71d39801ceeee421a0c8ded333.png)
Luogu_ P2010 [noip2016 popularization group] reply date_ Half enumeration

基于OpenCV实现口罩识别

Realization of mask recognition based on OpenCV

监控容器运行时工具Falco

What website can you find English literature on?

Digital twin visualization solution digital twin visualization 3D platform
随机推荐
实用系列丨免费可商用视频素材库
国外的论文在那找?
Xcode real machine debugging
Returns the maximum distance between two nodes of a binary tree
MFC gets the current time
[shutter] shutter photo wall (center component | wrap component | clickrrect component | stack component | positioned component | button combination component)
What website can you find English literature on?
Many to one, one to many processing
Optimization of streaming media technology
CADD课程学习(4)-- 获取没有晶体结构的蛋白(SWISS-Model)
Bean load control
yolov5detect. Py comment
Chapter 4 of getting started with MySQL: data types stored in data tables
Practical series - free commercial video material library
67 page overall planning and construction plan for a new smart city (download attached)
Happy Lantern Festival, how many of these technical lantern riddles can you guess correctly?
Request and response
95 pages of smart education solutions 2022
Master the development of facial expression recognition based on deep learning (based on paddlepaddle)
【OJ】两个数组的交集(set、哈希映射 ...)