Help! Error when migrating SQL file to TiDB and connecting to TiDB

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 救!sql文件迁移TiDB 连接到TiDB时报错

| username: TiDBer_kmB0dl9H

[Test Environment for TiDB] Testing
[Encountered Issue: Problem Description and Impact] When using TiDB Lightning for migration in the company’s test environment, the configuration file was set with the IP and user information of the test environment’s TiDB cluster. However, an error occurred during the migration. The specific details can be seen in the log screenshot. The log shows that access was denied, but the IP mentioned is not my TiDB’s IP; it is the IP of my current environment.
[Resource Configuration] Navigate to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page

| username: xingzhenxiang | Original post link

First, use the MySQL command to check if the username and password are correct.

| username: TiDBer_kmB0dl9H | Original post link

The existing SQL file is used to migrate to TiDB, but the IP address in the log connection refusal is different from the TiDB IP I configured. I don’t know why. The TiDB username and password are correct.

| username: tidb菜鸟一只 | Original post link

Did you use HAProxy as a proxy?

| username: yulei7633 | Original post link

There might be an issue with the configuration file address.

| username: zhaokede | Original post link

Check the original configuration file before migration; there must be a mistake in the configuration or something that hasn’t been modified.

| username: oceanzhang | Original post link

Configuration file issue

| username: TiDBer_kmB0dl9H | Original post link

Thank you, I found that the password in the configuration file was entered incorrectly.

| username: zhanggame1 | Original post link

This error must be due to incorrect username or password.

| username: 江湖故人 | Original post link

First, log in to the client from the machine where lightling is located and check show processlist; to confirm the host field.

| username: 小龙虾爱大龙虾 | Original post link

MySQL displays users like this, treating the user and host address as the user. TiDB is the same as MySQL, showing the IP of your host is correct. It would display the same way if you failed to log in using the MySQL client.

| username: 像风一样的男子 | Original post link

Since it is an SQL file, the simplest method is to directly log in to the TiDB database using the MySQL client and then source this SQL file.

| username: kelvin | Original post link

Configuration file issue

| username: wangccsy | Original post link

Make sure the username and password are correct (preferably not hard-coded in the code).

| username: 春风十里 | Original post link

In addition to verifying the password, you should also check if your root has IP restrictions. If the host is %, it means there are no restrictions.

SELECT user, host FROM mysql.user WHERE user='root';
| username: dba远航 | Original post link

First, connect to TiDB to confirm whether this user exists.

| username: 哈喽沃德 | Original post link

First, the password is incorrect. Second, there is no permission. Generally, these are the two issues.

| username: zhanggame1 | Original post link

Username and password error minor issue

| username: 这里介绍不了我 | Original post link

The error is obvious.