Check Details
row_format
in the source database table cannot be FIXED
.
The values of the lower_case_table_names
variable in both the source and target databases must be the same.
The max_allowed_packet
parameter of the target database must be set to 4 MB or above.
The connect_timeout
variable of the source database must be above 10.
In migration from MySQL/TDSQL for MySQL/TDSQL-C to MySQL, if a time-consuming SQL statement is running on the source database, a warning will be reported, with the content being "A time-consuming SQL statement is running on the source database, which may cause table locks. Please try again later or process the SQL statement on the source database".
Troubleshooting
If the value of row_format
in a database table is FIXED
, an error will be reported when the storage length of each row of the table exceeds the limit. Therefore, you need to change the value of row_format
to DYNAMIC
so that the storage length of each row varies by the content length.
If a similar error occurs, fix it as follows:
1. Log in to the source database.
2. Set row_format
to DYNAMIC
.
alter table table_name row_format = DYNAMIC;
3. Check whether the configuration takes effect.
show table status like 'table_name'\\G;
The system will display a result similar to the following:
mysql> show table status like 'table_name'\\G;
*************************** 1. row ***************************
Name: table_name
Engine: InnoDB
Version: 10
Row_format: Dynamic
Rows: 5
......
1 row in set (0.00 sec)
4. Run the verification task again.
Making lower_case_table_names
have the same value in source and target databases
lower_case_table_names
sets the letter case sensitivity in MySQL. It has the following valid values:
Windows and macOS environments are case-insensitive, but Linux environments are case-sensitive. To ensure the compatibility between different operating systems, you need to use the same letter case sensitivity rule.
0
: The name of a stored table is in the specified letter case and is case-sensitive during comparison.
1
: The name of a stored table is in lowercase on the disk and is case-insensitive during comparison.
2
: The name of a stored table is in the specified letter case and is in lowercase during comparison.
If a similar error occurs, set the parameter in the source and target databases to the same value as follows:
1. Log in to the source database.
2. Check the values of lower_case_table_names
in the source and target databases.
show variables like '%lower_case_table_names%';
3. Modify the my.cnf
configuration file of the source database as follows:
Note
The default path of the my.cnf
configuration file is /etc/my.cnf
, subject to the actual conditions.
lower_case_table_names = 1
4. Run the following command to restart the database:
[$Mysql_Dir]/bin/mysqladmin -u root -p shutdown
[$Mysql_Dir]/bin/safe_mysqld &
5. Check whether the configuration takes effect.
show variables like '%lower_case_table_names%';
The system will display a result similar to the following:
mysql> show variables like '%lower_case_table_names%';
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| lower_case_table_names | 1 |
+------------------------+-------+
1 row in set (0.00 sec)
6. Run the verification task again.
Modifying the max_allowed_packet
parameter in the target database
max_allowed_packet
is the maximum size of a packet that can be transferred. If its value is too large, more memory will be used, causing packet losses and the inability to capture the SQL statements of large exception event packets. If its value is too small, program errors may occur, causing backup failures and frequent sending/receiving of network packets, which compromises the system performance.
If a similar error occurs, fix it as follows:
1. Log in to the target database.
2. Modify the max_allowed_packet
parameter.
set global max_allowed_packet = 4*1024*1024;
3. Check whether the configuration takes effect.
show global variables like '%max_allowed_packet%';
The system will display a result similar to the following:
mysql> show global variables like '%max_allowed_packet%';
+------------------------+---------+
| Variable_name | Value |
+------------------------+---------+
| max_allowed_packet | 4194304 |
+------------------------+---------+
1 row in set (0.00 sec)
4. Run the verification task again.
Modifying the connect_timeout
variable in the source database
connect_timeout
is the database connection timeout, and a connection request will be denied if the connection duration is greater than the value of connect_timeout
. If the value of connect_timeout
is too small, the database will be frequently disconnected, which will impact the database processing efficiency. Therefore, we recommend that you set a value greater than 10 for this parameter.
If a similar error occurs, fix it as follows:
1. Log in to the source database.
2. Modify the connect_timeout
parameter.
set global connect_timeout = 10;
3. Check whether the configuration takes effect.
show global variables like '%connect_timeout%';
The system will display a result similar to the following:
mysql> show global variables like '%connect_timeout%';
+------------------------+---------+
| Variable_name | Value |
+------------------------+---------+
| connect_timeout | 10 |
+------------------------+---------+
1 row in set (0.00 sec)
4. Run the verification task again.
Was this page helpful?