Environment: MacOS_Cetalina_10.15.1, Mysql8.0.18, Docker_2.0.0.3 1. Search mysql in docker repository docker search mysql 2. Pull mysql8.0 from the docker repository docker pull mysql:8.0 Remark: docker pull mysql //Pull the latest version by default 3. Check whether the local warehouse image is downloaded successfully docker images mysql:8.0 4. Install and run the mysql8.0 container docker run -p 3307:3306 --name mysql8.0 -e MYSQL_ROOT_PASSWORD=root -d mysql:8.0 Remark: -p maps the local host port to the docker container port (because the local port 3306 is already occupied by other versions, use 3307) --name container name -e configuration information, configure root password -d image name 5. Check the running status of mysql8.0 container docker ps 6. Docker logs in to MySQL docker exec -it mysql8.0 bash mysql -uroot -p 7. Use the client connection tool (navicat) to remotely log in to MySQL I found that I couldn't log in. The error message was: Navicat does not support the caching_sha_password encryption method. Reason: MySQL 8.0 uses a new password encryption method: caching_sha_password 8. Use the client connection tool (navicat) to remotely log in to MySQL again 9. Postscript (commonly used docker commands) docker search image name //Search for imagesdocker pull image name: version number //Pull the image of the corresponding versiondocker pull image name //Pull the latest image by defaultdocker images //View the locally downloaded imagesdocker ps //View the running containersdocker ps -a //View all containers (including those in run, stop, and exited states) docker container ls //View running containersdocker rm container ID //Only delete containers that are not runningdocker rm -f container ID //Can delete running containersdocker run -p local host port number: container service port number--name container name[-e configuration information modification] -d image namedocker start container ID //Start containerdocker stop container ID //Terminate containerdocker rmi image name orID //Delete image The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Use of Linux network configuration tools
>>: Detailed code for implementing 3D tag cloud in Vue
In the process of web project development, we oft...
Writing method 1: update sas_order_supply_month_p...
Port mapping is not the only way to connect Docke...
● I was planning to buy some cloud data to provid...
Note When developing an article display list inte...
1. MySQL transaction concept MySQL transactions a...
First look at the effect: Code: 1.html <div cl...
Preface In project development, there are many wa...
<br />"There are no ugly women in the w...
Table of contents System update configuration Cha...
Table of contents 1. Object change detection 2. Q...
This article shares the specific code of vue elem...
Today, I set up a newly purchased Alibaba Cloud E...
Table of contents 1. Registering custom instructi...
Prepare the database (MySQL). If you already have...