The source and target databases need to be normally connected, and if not, the error message "Failed to connect to the source database" will be displayed.
A security group is similar to a firewall. It is a group of network security settings for databases in the cloud.
Check as follows based on the actual conditions:
iptables -Lcommand to check whether the server is configured with firewall policies.
Fix it as follows based on the actual conditions:
The firewall is enabled on the server:
Disable the server firewall, log in to DTS, and run the verification task again.
This method is applicable to both Windows and Linux.
Set the DTS IP range policy to Allow.
The SNAT IP range of DTS is blocked in the security group:
bind-addressconfiguration in the database. If it is not
0.0.0.0, the IP is blocked.
You can verify as follows:
email@example.com/8 // Authorize users to access through `10.0.0.0/8`, and other IPs will be blocked (incorrect configuration) root@% // Authorize users to access all IPs, which should include the SNAT IPs (correct configuration)
select host,user,authentication_string,password_expired,account_locked from mysql.user WHERE user='[\$Username]'; // `[\$Username]` is the database account entered in the data migration task
Check whether there is an endpoint or trigger that blocks the access source IP address in the source database.
datadirectory in the
$PGDATAdirectory, find the
pg_hba.conffile, and check whether the file contains a
denypolicy or only allows access from certain IP addresses over the network.
# cat pg_hba.conf local replication all trust host replication all 127.x.x.1/32 trust host replication all ::1/128 trust host all all 0.0.0.0/0 md5 host all all 172.x.x.0/20 md5
For self-built database, you need to check the
bind-address configuration in the database. If it is not
0.0.0.0, the IP is blocked.
mysql> grant all privileges on . to '[\$UserName]'@'%'; // `[\$Username]` is the database account entered in the data migration task mysql> flush privileges;
bind-addressconfiguration is incorrect, modify it as instructed below.
The default path of the
my.cnfconfiguration file is
/etc/my.cnf, subject to the actual conditions.
2.2. Restart the database.
bind-address=0.0.0.0 # All IP addresses or specified addresses
2.3. Check whether the configuration takes effect.
service mysqld restart
Disable the firewall or trigger.
pg_hba.conffile or temporarily open all IP ranges in the access policy during migration. For example, add the following line to the
host all all 0.0.0.0/0 md5
pg_ctl -D $PGDATA restart
bind-address as instructed in MySQL.
Below are the default ports for common databases. You need to check whether they are opened, and if not, open them based on the actual conditions:
Open the corresponding database port.
If the source database is SQL Server, you need to open the file sharing service port 445 at the same time.
Log in to the source database to check whether the account and password are correct.
Modify the data migration task in the DTS console, enter the correct database account and password, and run the verification task again.