DTS 从ECS自建数据库迁移数据到RDS
问题描述 : 测试连接成功,预检查一直失败
检测结果:失败
失败原因: 源库的账号或密码有误导致连接失败
失败详情: DTS-002010 Unknow connect db jdbc:mysql://****:3306?characterEncoding=utf8 failure. Original error: For more information please refer to https://help.aliyun.com/document_detail/91420.htm
解决方案: (1)请修改任务配置,填写正确的账号密码后重新进行预检查(2)请联系值班同学协助排查网络问题后重试
在ECS上登录数据库,执行下
mysql> select user,host from mysql.user;
+---------------+-----------+
| user | host |
+---------------+-----------+
| account | % |
| 用户名 | % |
| account | localhost |
| 用户名 | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
+---------------+-----------+
这时候就要删除一个localhost
mysql> DELETE FROM `user` WHERE Host='localhost' AND User='用户名';
Query OK, 0 rows affected (0.00 sec)
mysql> select user,host from mysql.user;
+---------------+-----------+
| user | host |
+---------------+-----------+
| account | % |
| 用户名 | % |
| account | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
+---------------+-----------+
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
现在重试预检查就能过了
网友评论