Problems when connecting to Tencent Cloud MySQL remotely

background:

In the linux environment, first install docker, then download the mysql image in docker, and then set up the security group, firewall, port mapping, and finally connect to mysql remotely in the windows environment, the error is as follows

error

Errors reported when using Navicat to connect:

1251-Client does not support authentication protocol requested by server; consider upgrading MysQL client

Error one
Errors reported when using cmd to connect:

ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: ÕÒ²»µ½Ö¸¶¨µÄÄ£¿é¡£

Error two

Solution:

  1. First enter the mysql container:
docker exec -it 你的mysql的container_name /bin/bash
例如:docker exec -it mysql01 /bin/bash
  1. Enter mysql
mysql -uroot -p你的密码
  1. Modify the password
    ALTER USER'root'@'%' IDENTIFIED WITH mysql_native_password BY'root';
    then the problem will be solved by being confused (funny).

Guess you like

Origin blog.csdn.net/TreeCode/article/details/108175312