排查连接到源数据库时出现的 DMS 错误Troubleshoot DMS errors when connecting to source databases

以下文章详细介绍了如何解决将 Azure 数据库迁移服务 (DMS) 连接到源数据库时可能会遇到的问题。The following article provides detail about how to address potential issues you might encounter when connecting the Azure Database Migration Service (DMS) to your source database. 以下每个部分与特定类型的源数据库相关,列出了可能会遇到的错误,以及有关如何排查连接问题的信息的链接。Each section below relates to a specific type of source database, listing the error you might encounter together with detail and links to information about how to troubleshoot the connectivity.

SQL ServerSQL Server

下表提供了连接到源 SQL Server 数据库时可能会出现的问题及其解决方法。Potential issues associated with connecting to a source SQL Server database and how to address them are provided in the following table.

错误Error 原因和故障排除详细信息Cause and troubleshooting detail
SQL 连接失败。SQL connection failed. 建立与 SQL Server 的连接时,出现网络相关或特定于实例的错误。A network-related or instance-specific error occurred while establishing a connection to SQL Server. 找不到或无法访问服务器。The server was not found or was not accessible. 验证实例名称是否正确,以及 SQL Server 是否已配置为允许远程连接。Verify that the instance name is correct, and that SQL Server is configured to allow remote connections.
如果服务找不到源服务器,则会发生此错误。This error occurs if the service can't locate the source server. 若要解决该问题,请参阅使用动态端口或命名实例连接到源 SQL Server 时出错To address the issue, see the article Error connecting to source SQL Server when using dynamic port or named instance.
错误 53 - SQL 连接失败。Error 53 - SQL connection failed. (同样适用于错误代码 1、2、5、53、233、258、1225、11001)(Also, for error codes 1, 2, 5, 53, 233, 258, 1225, 11001)

如果服务无法连接到源服务器,则会发生此错误。This error occurs if the service can't connect to the source server. 若要解决该问题,请参考以下资源,然后重试。To address the issue, refer to the following resources, and then try again.

有关排查连接问题的交互式用户指南Interactive user guide to troubleshoot the connectivity issue

将 SQL Server 迁移到 Azure SQL 数据库的先决条件Prerequisites for migrating SQL Server to Azure SQL Database

将 SQL Server 迁移到 Azure SQL 托管实例的先决条件Prerequisites for migrating SQL Server to an Azure SQL Managed Instance
错误 18456 - 登录失败。Error 18456 - Login failed.
如果服务无法使用提供的 T-SQL 凭据连接到源数据库,则会发生此错误。This error occurs if the service can’t connect to the source database using the provided T-SQL credentials. 若要解决该问题,请检查输入的凭据。To address the issue, verify the entered credentials. 还可以参考 MSSQLSERVER_18456 或此表下面的注释中列出的故障排除文档,然后重试。You can also refer to MSSQLSERVER_18456 or to the troubleshooting documents listed in the note below this table, and then try again.
提供了格式不当的 AccountName 值“{0}”。Malformed AccountName value '{0}' provided. AccountName 的所需格式为“域名\用户名”Expected format for AccountName is DomainName\UserName
如果用户选择了 Windows 身份验证但提供了格式无效的用户名,则会发生此错误。This error occurs if the user selects Windows authentication but provides the username in an invalid format. 若要解决该问题,请为 Windows 身份验证提供正确格式的用户名,或选择“SQL 身份验证”。 To address the issue, either provide username in the correct format for Windows authentication or select SQL Authentication .

AWS RDS MySQLAWS RDS MySQL

下表提供了连接到源 AWS RDS MySQL 数据库时可能会出现的问题及其解决方法。Potential issues associated with connecting to a source AWS RDS MySQL database and how to address them are provided in the following table.

错误Error 原因和故障排除详细信息Cause and troubleshooting detail
错误 [2003] [HY000] - 连接失败。Error [2003] [HY000] - connection failed. 错误 [HY000] [MySQL][ODBC x.x(w) 驱动程序] 无法连接到 '{server}' 上的 MySQL 服务器 (10060)ERROR [HY000] [MySQL][ODBC x.x(w) driver] Can't connect to MySQL server on '{server}' (10060) 如果 MySQL ODBC 驱动程序无法连接到源服务器,则会发生此错误。This error occurs if the MySQL ODBC driver can't connect to the source server. 若要解决该问题,请参考此表下面的注释中列出的故障排除文档,然后重试。To address the issue, refer to the troubleshooting documents listed in the note below this table, and then try again.
错误 [2005] [HY000] - 连接失败。Error [2005] [HY000] - connection failed. 错误 [HY000] [MySQL][ODBC x.x(w) 驱动程序] 未知的 MySQL 服务器主机 '{server}'ERROR [HY000] [MySQL][ODBC x.x(w) driver] Unknown MySQL server host '{server}' 如果服务在 RDS 上找不到源主机,则会发生此错误。This error occurs if the service can't find the source host on RDS. 此问题的原因可能是列出的源不存在,或者 RDS 基础结构有问题。The issue could either be because the listed source does not exist or there is a problem with RDS infrastructure. 若要解决该问题,请参考此表下面的注释中列出的故障排除文档,然后重试。To address the issue, refer to the troubleshooting documents listed in the note below this table, and then try again.
错误 [1045] [HY000] - 连接失败。Error [1045] [HY000] - connection failed. 错误 [HY000] [MySQL][ODBC x.x(w) 驱动程序] 拒绝 '{server}' 上的用户 '{user}' 访问(使用密码:是)ERROR [HY000] [MySQL][ODBC x.x(w) driver] Access denied for user '{user}'@'{server}' (using password: YES) 如果由于凭据无效,导致 MySQL ODBC 驱动程序无法连接到源服务器,则会发生此错误。This error occurs if MySQL ODBC driver cannot connect to the source server due to invalid credentials. 请检查输入的凭据。Verify the credentials you have entered. 如果该问题持续出现,请检查源计算机是否具有正确的凭据。If the issue continues, verify that source computer has the correct credentials. 可能需要在控制台中重置密码。You may need to reset the password in the console. 如果依然遇到该问题,请参考此表下面的注释中列出的故障排除文档,然后重试。If you still encounter the issue, refer to the troubleshooting documents listed in the note below this table, and then try again.
错误 [9002] [HY000] - 连接失败。Error [9002] [HY000] - connection failed. 错误 [HY000] [MySQL][ODBC x.x(w) 驱动程序] 连接字符串可能不正确。ERROR [HY000] [MySQL][ODBC x.x(w) driver] The connection string may not be right. 访问门户以获得参考信息。Visit portal for references. 如果连接字符串问题导致连接失败,则会发生此错误。This error occurs if the connection is failing due to an issue with the connection string. 请检查连接字符串是否有效。Verify the connection string provided is valid. 若要解决该问题,请参考此表下面的注释中列出的故障排除文档,然后重试。To address the issue, refer to the troubleshooting documents listed in the note below this table, and then try again.
二进制日志记录出错。变量 binlog_format 的值为 '{value}'。请将其更改为 'row'。Error in binary logging. Variable binlog_format has value '{value}'. Please change it to 'row'. 如果二进制日志记录存在错误,则会发生此错误。变量 binlog_format 的值不正确。This error occurs if there is an error in binary logging; the variable binlog_format has the wrong value. 若要解决该问题,请将参数组中的 binlog_format 更改为 'ROW',然后重新启动实例。To address the issue, change the binlog_format in parameter group to 'ROW', and then reboot the instance. 有关详细信息,请参阅二进制日志记录选项和变量AWS RDS MySQL 数据库日志文件文档For more information, see to Binary Logging Options and Variables or AWS RDS MySQL Database Log Files documentation.

备注

有关排查连接到源 AWS RDS MySQL 数据库时出现的问题的详细信息,请参阅以下资源:For more information about troubleshooting issues related to connecting to a source AWS RDS MySQL database, see the following resources:

AWS RDS PostgreSQLAWS RDS PostgreSQL

下表提供了连接到源 AWS RDS PostgreSQL 数据库时可能会出现的问题及其解决方法。Potential issues associated with connecting to a source AWS RDS PostgreSQL database and how to address them are provided in the following table.

错误Error 原因和故障排除详细信息Cause and troubleshooting detail
错误 [101] [08001] - 连接失败。Error [101] [08001] - connection failed. 错误 [08001] 已超时。ERROR [08001] timeout expired. 如果 Postgres 驱动程序无法连接到源服务器,则会发生此错误。This error occurs if the Postgres driver can’t connect to the source server. 若要解决该问题,请参考此表下面的注释中列出的故障排除文档,然后重试。To address the issue, refer to the troubleshooting documents listed in the note below this table, and then try again.
错误:参数 wal_level 的值为 '{value}'。请将其更改为 'logical' 以允许复制。Error: Parameter wal_level has value '{value}'. Please change it to 'logical' to allow replication. 如果参数 wal_level 的值不正确,则会发生此错误。This error occurs if the parameter wal_level has the wrong value. 若要解决该问题,请将参数组中的 rds.logical_replication 更改为 1,然后重新启动实例。To address the issue, change the rds.logical_replication in parameter group to 1, and then reboot the instance. 有关详细信息, 请参阅使用 DMS 迁移到 Azure PostgreSQL 的先决条件Amazon RDS 上的 PostgreSQLFor more information, see to Pre-requisites for migrating to Azure PostgreSQL using DMS or PostgreSQL on Amazon RDS.

备注

有关排查连接到源 AWS RDS PostgreSQL 数据库时出现的问题的详细信息,请参阅以下资源:For more information about troubleshooting issues related to connecting to a source AWS RDS PostgreSQL database, see the following resources:

AWS RDS SQL ServerAWS RDS SQL Server

下表提供了连接到源 AWS RDS SQL Server 数据库时可能会出现的问题及其解决方法。Potential issues associated with connecting to a source AWS RDS SQL Server database and how to address them are provided in the following table.

错误Error 原因和故障排除详细信息Cause and troubleshooting detail
错误 53 - SQL 连接失败。Error 53 - SQL connection failed. 建立与 SQL Server 的连接时,出现网络相关或特定于实例的错误。A network-related or instance-specific error occurred while establishing a connection to SQL Server. 找不到或无法访问该服务器。The server wasn't found or wasn't accessible. 验证实例名称是否正确,以及 SQL Server 是否已配置为允许远程连接。Verify that the instance name is correct, and that SQL Server is configured to allow remote connections. (提供程序:命名管道提供程序,错误:40 - 无法与 SQL Server 建立连接)(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server 如果服务无法连接到源服务器,则会发生此错误。This error occurs if the service can’t connect to the source server. 若要解决该问题,请参考此表下面的注释中列出的故障排除文档,然后重试。To address the issue, refer to the troubleshooting documents listed in the note below this table, and then try again.
错误 18456 - 登录失败。Error 18456 - Login failed. 用户 '{user}' 登录失败Login failed for user '{user}' 如果服务无法使用提供的 T-SQL 凭据连接到源数据库,则会发生此错误。This error occurs if the service can’t connect to the source database with the T-SQL credentials provided. 若要解决该问题,请检查输入的凭据。To address the issue, verify the entered credentials. 还可以参考 MSSQLSERVER_18456 或此表下面的注释中列出的故障排除文档,然后重试。You can also refer to MSSQLSERVER_18456 or to the troubleshooting documents listed in the note below this table, and try again.
错误 87 - 连接字符串无效。Error 87 - Connection string is not valid. 建立与 SQL Server 的连接时,出现网络相关或特定于实例的错误。A network-related or instance-specific error occurred while establishing a connection to SQL Server. 找不到或无法访问服务器。The server was not found or was not accessible. 验证实例名称是否正确,以及 SQL Server 是否已配置为允许远程连接。Verify that the instance name is correct, and that SQL Server is configured to allow remote connections. (提供程序:SQL 网络接口,错误:25 - 连接字符串无效)(provider: SQL Network Interfaces, error: 25 - Connection string is not valid) 如果连接字符串无效,导致服务无法连接到源服务器,则会发生此错误。This error occurs if the service can’t connect to the source server because of an invalid connection string. 若要解决该问题,请检查提供的连接字符串。To address the issue, verify the connection string provided. 如果问题持续出现,请参考此表下面的注释中列出的故障排除文档,然后重试。If the issue persists, refer to the troubleshooting documents listed in the note below this table, and then try again.
错误 - 服务器证书不受信任。Error - Server certificate not trusted. 已成功与服务器建立连接,但在登录过程中发生错误。A connection was successfully established with the server, but then an error occurred during the login process. (提供程序:SSL 提供程序,错误:0 - 证书链是不受信任的颁发机构颁发的。)(provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.) 如果使用的证书不受信任,则会发生此错误。This error occurs if the certificate used isn't trusted. 若要解决该问题,需要找到可信的证书,然后在服务器上启用它。To address the issue, you need to find a certificate that can be trusted, and then enable it on the server. 或者,可以在连接时选择“信任证书”选项。Alternatively, you can select the Trust Certificate option while connecting. 请仅在你熟悉所用的证书并且信任它时,才执行此操作。Take this action only if you're familiar with the certificate used and you trust it.
使用自签名证书加密的 TLS 连接不提供强安全性 -- 它们容易受到中间人攻击。TLS connections that are encrypted using a self-signed certificate don't provide strong security -- they're susceptible to man-in-the-middle attacks. 请勿在生产环境中或在连接到 Internet 的服务器上依赖使用自签名证书的 TLS。Do not rely on TLS using self-signed certificates in a production environment or on servers that are connected to the internet.
有关详细信息,请参阅对 Microsoft SQL Server 数据库实例使用 SSL教程:使用 DMS 将 RDS SQL Server 迁移到 AzureFor more information, see to Using SSL with a Microsoft SQL Server DB Instance or Tutorial: Migrate RDS SQL Server to Azure using DMS.
错误 300 - 用户没有所需的权限。Error 300 - User does not have required permissions. 已拒绝对对象 '{server}',数据库 '{database}' 的 VIEW SERVER STATE 权限VIEW SERVER STATE permission was denied on object '{server}', database '{database}' 如果用户无权执行迁移,则会发生此错误。This error occurs if user doesn't have permission to perform the migration. 若要解决该问题,请参考授予服务器权限 - Transact-SQL教程:使用 DMS 将 RDS SQL Server 迁移到 Azure 了解更多详细信息。To address the issue, refer to GRANT Server Permissions - Transact-SQL or Tutorial: Migrate RDS SQL Server to Azure using DMS for more details.

备注

有关排查连接到源 AWS RDS SQL Server 时出现的问题的详细信息,请参阅以下资源:For more information about troubleshooting issues related to connecting to a source AWS RDS SQL Server, see the following resources:

已知问题Known issues

后续步骤Next steps