We failed to connect to the MySQL server because DMS and the MySQL server cannot be connected. We recommend that you check the connection strings, network conditions, and whitelist settings before trying again. The error occurred, the system displays a similar output:
This problem generally occurred on the self-built MySQL server. The possible causes of the problem are as follows.
The Firewall limits of the ECS instance or the host where the user-created MySQL server is located.
The ECS Security Group is not open to DMS.
MySQL server not started.
MySQL servers only allow local login by the root account.
In response to the above problems, please check the following settings in sequence.
Check the firewall rules of the ECS instance or the MySQL server. Confirm that the MySQL service port (the default port is 3306) is open. Confirm that the IP address of DMS is not restricted or add to the firewall whitelist. For more information, see what is the IP address used to log on to ECS in DMS?
Add the IP address of the DMS enterprise to the inbound settings of the security group of the ECS instance.
On the MySQL server, run the following command to check whether the MySQL process is normal:
ps -ef | grep mysql
If the MySQL process is normal, log on to the MySQL server as the root user and run the following command to check whether the root account is only allowed to log on to the local server.
show grants for root@'%';
If the root account is only allowed to log on locally, run the following command to allow the root account to log on from any remote address.
use mysql; update user set host = '%' where user = 'root'; FLUSH PRIVILEGES;
Note: you can specify any remote address. To ensure data security, we recommend that you set a value based on your needs.