当前位置:网站首页>Who has docker to install MySQL locally?
Who has docker to install MySQL locally?
2022-07-07 07:58:00 【Wu_ Candy】
introduction
When developing projects or scripts on personal computers , We often encounter the problem of data storage , In our work project Mysql It is a common business database , If you want to store data , Except for installing on our personal computers Mysql Is there no other choice for service ?
No,No, You can also choose not to install on your own computer Mysql Services can also solve data storage problems .
That is to use Docker Start a Mysql service , The development program can pass Host, Port Direct connection , Then start to increase at will , Delete , Change , Check the business data you created !
Today's share :
No local installation required Mysql service , Use Docker Super fast start Mysql Services realize data storage !
Operation steps
1. install Docker
Enter official website (https://www.docker.com/) Download the appropriate according to the operating system Docker edition , After downloading and installing successfully , The following whale icon will appear on the desktop .

2. start-up Docker
Double click the whale icon , After startup Docker The interface is as follows :

The two menus on the left are :
Containers/Apps
Images
Containers/Apps: Indicates that the container service has been started
Images: Indicates an existing local image , The list shown in the following figure shows the images I have pulled locally

3.Docker Pull Mysql Mirror image
Pull Mysql The latest version of the mirroring command :
docker pull mysql # No addition :latest By default, the latest version of the image is pulled
docker pull mysql:latest
Pull Mysql Specify the version mirroring command :
docker pull mysql:8.0.18

Search for Mysql Available version mirroring commands :
docker search mysql

4. View local image
docker images
You can see from the picture that you just pulled Mysql The image has been transferred to the local image list

5. Start the container
docker run -itd --name mysql-test -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql
Parameter description :
-p 3306:3306 : Mapping container service's 3306 Port to host 3306 port , External hosts can go directly through The host machine ip:3306 Access to the MySQL Service for .
MYSQL_ROOT_PASSWORD=123456: Set up MySQL service root User's password .
mysql-test: Indicates the name of the container started , This name can be customized

A long string container will be returned if the normal container is successfully started id, As shown in the figure above .
6. Check the container process started
docker ps

In addition to the command line window, you can view , You can also use the launched desktop version Docker To view the , As shown in the figure below

7.Navicat Tool connection Mysql service
(1). Use Navicat Tool connection just used Docker Container enabled Mysql service
According to the parameters set by the startup container , stay Navicat New China Mysql Connect


(2). see Mysql Database under

Summary
1. The program code can easily connect this Mysql service Increase data , Delete , Change , check .
2. Use Docker To start up Mysql The service saves local installation Mysql Steps for , relatively speaking Relatively light and fast .
Welcome to your attention 【 The way of immeasurable testing 】 official account , reply 【 Claim resources 】
Python+Unittest frame API automation 、
Python+Unittest frame API automation 、
Python+Pytest frame API automation 、
Python+Pandas+Pyecharts Big data analysis 、
Python+Selenium frame Web Of UI automation 、
Python+Appium frame APP Of UI automation 、
Python Programming learning resources dry goods 、
Vue Front end component framework development 、
Resources and code Free ~
Below the official account is two-dimensional code. , You can directly scan wechat and pay attention .
remarks : My official account has been officially opened. , betake IT Sharing of Internet technology .
contain : Data analysis 、 big data 、 machine learning 、 Test Development 、API Interface automation 、 Test operation and maintenance 、UI automation 、 Performance testing 、 code detection 、 Programming technology, etc .
WeChat search official account :“ The way of immeasurable testing ”, Or scan the qr code below :
Add the attention , Let's grow together !
边栏推荐
- Button wizard collection learning - mineral medicine collection and running map
- nacos
- leetcode:105. Constructing binary trees from preorder and inorder traversal sequences
- 2022年全国最新消防设施操作员(初级消防设施操作员)模拟题及答案
- C language communication travel card background system
- 知识点滴 - 关于苹果认证MFI
- Weibo publishing cases
- 【obs】win-capture需要winrt
- [UVM practice] Chapter 2: a simple UVM verification platform (2) only driver verification platform
- Numbers that appear only once
猜你喜欢

Numbers that appear only once

Shell 脚本的替换功能实现
![[GUET-CTF2019]虚假的压缩包](/img/a2/7da2a789eb49fa0df256ab565d5f0e.png)
[GUET-CTF2019]虚假的压缩包

Detailed explanation of Kalman filter for motion state estimation
![[SUCTF 2019]Game](/img/9c/362117a4bf3a1435ececa288112dfc.png)
[SUCTF 2019]Game

Explore Cassandra's decentralized distributed architecture

这5个摸鱼神器太火了!程序员:知道了快删!

【webrtc】m98 screen和window采集

Asemi rectifier bridge rs210 parameters, rs210 specifications, rs210 package

Leetcode 90: subset II
随机推荐
What are the positions of communication equipment manufacturers?
[2022 actf] Web Topic recurrence
Solution: could not find kf5 (missing: coreaddons dbusaddons doctools xmlgui)
Codeforces Global Round 19
Solve could not find or load the QT platform plugin "xcb" in "
2022 welder (elementary) judgment questions and online simulation examination
【数字IC验证快速入门】17、SystemVerilog学习之基本语法4(随机化Randomization)
Kbu1510-asemi power supply special 15A rectifier bridge kbu1510
IO stream file
Installing postgresql11 database under centos7
paddlepaddle 29 无模型定义代码下动态修改网络结构(relu变prelu,conv2d变conv3d,2d语义分割模型改为3d语义分割模型)
C language flight booking system
Figure out the working principle of gpt3
The principle and implementation of buffer playback of large video files
[webrtc] M98 screen and window acquisition
C语言二叉树与建堆
2022制冷与空调设备运行操作复训题库及答案
Linux server development, redis source code storage principle and data model
Button wizard collection learning - mineral medicine collection and running map
Common validation comments