1. Download Image
docker pull mysql:8.0.26
2. Operation container
docker run -p 3306:3306 --restart=always -e MYSQL_ROOT_PASSWORD=ang123 --name mysql -d mysql:8.0.26
3. At this time, an error will be reported when using Navicat to log in, because the encryption methods of mysql8 and 5 are different, and the encryption method needs to be modified
4. Enter MySQL container
docker exec -it mysql bash
5. Log in to MySQL and modify the encryption method
mysql -uroot -pang123;
use mysql;
#Modify encryption method
alter user 'root'@'%' identified with mysql_native_password by 'root';
#View modified data
select host,user,plugin from user;
Revised as follows:
6.At this time, the local Navicat remote connection to MySQL in Linux still reports an error 1045, but the password is correct, and the grant authorization does not solve the problem
The final solution is as follows. Just change the password again. The password is still the original password
ALTER USER 'root'@'%' IDENTIFIED WITH MYSQL_NATIVE_PASSWORD BY 'ang123';
#Make changes effective
flush privileges;
7. At this time, Navicat can be used for remote connection
Read More:
- [Solved] MySQL 8 Connect Navicat error: error 2059
- [Solved] Navicat Connect MySQL error: Authentication plugin ‘caching_sha2_password‘ cannot be loaded
- [Solved] Navicat connection error 1251 compatibility with docker MySQL
- [Solved] Sqlyog always reports an error when creating a new connection.
- [Solved] ERROR 1396 (HY000): Operation ALTER USER failed for ‘root‘@‘localhost‘
- Docker mysql8 modify password
- Mysql 8.0.13 Enabling remote access (ERROR 1064 (42000): You have an error in your SQL syntax; check the manual th)
- Navicat connected to Mysql error: Client does not support authentication protocol requested by server;
- [Solved] There is a problem with mysql8.0 without password in Navicat connection
- ERROR: mysqld failed while attempting to check config [How to Solve]
- MySQL (version 8.0) connection error: 1251 [How to Solve]
- [Solved] Error response from daemon: Conflict. The container name “/mysql is already in use by container
- [Solved] SQLSTATE[HY000] [2002] Connection refused to report an error when PHP connects to mysql in the docker container
- MYSQL Error 1045 (28000): access denied for user ‘root’ @’localhost ‘(using password: Yes)
- [Solved] mysql 2003 remote access failed mysql8 configure remote access
- [Solved] Worker 1 failed executing transaction ‘ANONYMOUS‘ at master log mall-mysql-bin.000001, end_log_pos
- [Solved] MySQL Error: Client does not support authentication protocol requested by server
- MYSQL Use cmd to change root password error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual tha
- Remote connection to MySQL database error: is not allowed to connect to this MYSQL server solution
- How To Change ASM SYS PASSWORD