Navicat connection mysql error in docker lamp container, error code 2003

I ran a container using mattrayner/lamp in docker hub, exposing ports 3306 and 8081 for external use. When using navicat to try to connect to mysql Times error: 2003-cant"t connect to mysql server on ip (10061 "unknown error")

dockerfiledocker-compose.yml


up

:
dockerping ip ping telnet ip 3306

select host,user from mysql.user;:

how can I connect with navicat? Thank you, prawns.

Is

mapping native? 127.0.0.1?


did you use your local navicat to connect to the mysql in Aliyun docker?
mysql does not allow remote connections by default. You need to open remote connections in mysql.


docker has not been used, but it should be about the same as VM. Let's take a look at whether the mysql service is started. My telnet 139.199.17.176 3306 cannot be accessed. Normally, the firewall is enabled and port 3306 is not open.
in addition, it is recommended to perform select host,user from mysql.user; post to see


MySQL5.7 version can not be connected with Navicat for MySQL, to change to Navicat Premium or Workbench client

Menu