First, the installation of Docker:
Check if your own amount is above 3.10, or Centos7
1. Uname-r
2. Install Docker command: Yum -y install docker-io
3. Start the Docker command: Service Docker start
Second, install MySQL on the Docker
1. Docker pull MySQL (the default is to install the latest version)
2. Docker run-it--rm--name mysql-e mysql_root_password=123456-p 3306:3306-d MySQL
Command explanation:
--name: Container Name
--P: Mapping host host ports
-E: Setting the environment variable, specifying the root password here
-D: Running containers in the background
Test whether the installation was successful
Then you can connect locally navicat, I reported a mistake when I connected.
Client does authentication protocol requested by Server; Consider upgrading MySQL client
Mysql-h192.168.1.17-p3306-u root-p connected. Then set the following:
ALTER user ' root ' @'% ' identified with Mysql_native_password by ' root ';
FLUSH privileges;
Then you can connect successfully.
Record the process of installing MySQL under Docker and Docker