当前位置:网站首页>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 !
边栏推荐
- padavan手动安装php
- Most elements
- [experience sharing] how to expand the cloud service icon for Visio
- MySQL multi column index (composite index) features and usage scenarios
- [performance pressure test] how to do a good job of performance pressure test?
- Thinkcmf6.0安装教程
- Value sequence (subsequence contribution problem)
- 3D reconstruction - stereo correction
- [unity] several ideas about circular motion of objects
- Idea add class annotation template and method template
猜你喜欢

Codeforces Global Round 19

Operation suggestions for today's spot Silver

Ansible

Linux server development, redis source code storage principle and data model

Cnopendata American Golden Globe Award winning data

Detailed explanation of uboot image generation process of Hisilicon chip (hi3516dv300)

numpy中dot函数使用与解析

即刻报名|飞桨黑客马拉松第三期等你挑战
![[guess-ctf2019] fake compressed packets](/img/a2/7da2a789eb49fa0df256ab565d5f0e.png)
[guess-ctf2019] fake compressed packets

Mysql高低版本切换需要修改的配置5-8(此处以aicode为例)
随机推荐
[2022 actf] Web Topic recurrence
Live broadcast platform source code, foldable menu bar
2022制冷与空调设备运行操作复训题库及答案
Common method signatures and meanings of Iterable, collection and list
Linux server development, MySQL index principle and optimization
3D reconstruction - stereo correction
[experience sharing] how to expand the cloud service icon for Visio
[GUET-CTF2019]虚假的压缩包
Custom class loader loads network class
buuctf misc USB
Codeforces Global Round 19
Leetcode 43 String multiplication (2022.02.12)
mysql多列索引(组合索引)特点和使用场景
【经验分享】如何为visio扩展云服务图标
芯片 設計資料下載
C语言航班订票系统
json 数据展平pd.json_normalize
2022年茶艺师(中级)考试试题及模拟考试
Pytorch parameter initialization
Linux server development, MySQL process control statement