Service Listening Address
1 Problem Description
After setting up the MySQL service on ECS, everything was normal with the firewall security group, yet remote access was not possible.
2 Troubleshooting
2.1 Check Connectivity
Use a local computer to scan the server ports, and the results are as follows:
|
|
The results indicate that port 3306 is allowed, but the server is not functioning properly.
2.2 Check Ports
Check the usage of all ports on ECS:
|
|
MySQL is bound to the local loopback address, so it cannot provide external services. This is where the problem lies.
3 Binding Address Configuration
MySQL’s default configuration is to listen to the service address on 127.0.0.1, which does not provide external services. Change the binding address to 0.0.0.0 to support remote access, configure as follows:
|
|
Modify the bind-address to 0.0.0.0, note that you cannot simply comment it out, otherwise it will result in the second outcome below.
|
|
The third result appears, and local access is also successful.
4 Summary
Many software and frameworks default to binding the address to 127.0.0.1, which cannot be accessed from other machines. It needs to be changed to 0.0.0.0 or :::, the former provides IPv4 services, and the latter provides IPv6 services.
Alipay
PayPal
WeChat Pay