Service Listening Address
Problem Description
Set up a MySQL server on ECS, firewall and security group are all normal, but cannot be accessed remotely.
Troubleshooting
Check Connectivity
Scanned the server ports using a local computer, results as follows:
|
|
The result indicates port 3306 is open, but the server is not functioning properly.
Check Port
Checked all port usage on ECS:
|
|
MySQL is bound to the localhost loopback address, thus unable to provide external services. That’s where the problem lies.
Binding Address Configuration
MySQL’s default configuration listens to the service address on 127.0.0.1
, which does not provide external services. To support remote access, the binding address should be changed to 0.0.0.0
by making the following configuration:
|
|
Change the bind-address to 0.0.0.0, note that you cannot just comment it out, otherwise, it will lead to the following second outcome.
|
|
The third outcome appears, local access is also successful.
Summary
Many software and frameworks, by default, bind 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, while the latter provides ipv6 services.
![Tim Alipay](/img/alipay.png)
![Tim PayPal](/img/paypal.png)
![Tim WeChat Pay](/img/wechatpay.png)