当前位置:网站首页>Docker installation MySQL

Docker installation MySQL

2022-04-23 18:01:00 Shallow singing ~ happiness

1. View available MySQL edition    visit MySQL Image library address :https://hub.docker.com/_/mysql?tab=tags .    Can pass Sort by View other versions of MySQL, The default is the latest version  mysql:latest 

 

 

2. We can still use it  docker search mysql  Command to view the available versions

3. Pull MySQL Mirror image Here I pull it is 5.7 Of     command :docker pull mysql:5.7

4. Check to see if... Is installed mysql:  

docker images

5. Use the following command to run mysql Containers :

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 .

 

6. use docker ps  Command to see if :

7. Into the container     command :docker exec -it ae2026c8ee58 bash

8. Sign in mysql    

mysql -u root -p

9. to grant authorization
Authorization command :GRANT ALL PRIVILEGES ON *.* TO [email protected]"%" IDENTIFIED BY "123456";
Refresh command :flush privileges;

sign out :exit

 

10 Navicat Connect :

 

 

 

 

 

 

 

 

版权声明
本文为[Shallow singing ~ happiness]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231800323039.html