使用Navicat连接docker容器中的mysql报错10060:unknow error
1、在docker部署mysql后并登录
root@09fb195aab18:/# mysql -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.50 MySQL Community Server (GPL)
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
因此可以确定部署mysql成功
2、使用navicat连接容器的mysql时,报错10060


3、检查linux防火墙
[root@localhost ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since 二 2020-12-29 04:31:00 CST; 23min ago
Docs: man:firewalld(1)
Main PID: 695 (firewalld)
Tasks: 2
Memory: 2.3M
CGroup: /system.slice/firewalld.service
└─695 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid
12月 29 04:38:22 localhost.localdomain firewalld[695]: WARNING: COMMAND_FAILED: '/usr/sb....
12月 29 04:38:22 localhost.localdomain firewalld[695]: WARNING: COMMAND_FAILED: '/usr/sb....
12月 29 04:38:22 localhost.localdomain firewalld[695]: WARNING: COMMAND_FAILED: '/usr/sb....
12月 29 04:38:22 localhost.localdomain firewalld[695]: WARNING: COMMAND_FAILED: '/usr/sb....
12月 29 04:38:22 localhost.localdomain firewalld[695]: WARNING: COMMAND_FAILED: '/usr/sb....
12月 29 04:38:22 localhost.localdomain firewalld[695]: WARNING: COMMAND_FAILED: '/usr/sb....
12月 29 04:38:22 localhost.localdomain firewalld[695]: WARNING: COMMAND_FAILED: '/usr/sb....
12月 29 04:38:22 localhost.localdomain firewalld[695]: WARNING: COMMAND_FAILED: '/usr/sb....
12月 29 04:38:23 localhost.localdomain firewalld[695]: WARNING: COMMAND_FAILED: '/usr/sb....
12月 29 04:38:25 localhost.localdomain firewalld[695]: WARNING: COMMAND_FAILED: '/usr/sb....
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]#
发现防火墙已关闭,确定非防火墙问题
4、查看阿里云安全组配置规则端口

5、重启linux并再次连接navicat

版权声明:本文为weixin_46223196原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。