I have a question: I accidentally imported the MySQL database into TiDB. Now creating users is not working properly

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

Original topic: 提个问题 我不小心把mysql的 mysql库导入到tidb了。现在建用户不正常

| username: tidb狂热爱好者

【TiDB Usage Environment】Production environment or Test environment or POC
【TiDB Version】Version 6.1
【Encountered Problem】
【Reproduction Path】What operations were performed that led to the problem
Imported MySQL table
【Problem Phenomenon and Impact】
MySQL [(none)]> GRANT USAGE ON . TO ‘dba_yearning’@‘172.%’ IDENTIFIED BY ‘uAqIxdJqeZekHl5Y4EZmsaAz32U=’ WITH GRANT OPTION;
ERROR 1364 (HY000): Field ‘ssl_cipher’ doesn’t have a default value
【Attachments】

Please provide the version information of each component, such as cdc/tikv, which can be obtained by executing cdc version/tikv-server --version.

| username: songxuecheng | Original post link

The structures of the two tables are different, it will definitely report an error.

| username: 我是咖啡哥 | Original post link

How about starting a test environment with tiup playground and importing a MySQL table schema to try it out?

| username: tidb狂热爱好者 | Original post link

It’s a hassle to rebuild the system again.

| username: maokl | Original post link

You moved the system tables over as well, right?

| username: xingzhenxiang | Original post link

If testing, rebuilding once is more convenient.

| username: tidb狂热爱好者 | Original post link

I’m also puzzled as to how this MySQL table got in.

| username: Min_Chen | Original post link

Hello, may I ask what tool was used for the import, and what were the commands or configuration files like? Please share them so we can see why the MySQL database was overwritten.

| username: tidb狂热爱好者 | Original post link

Use mysqldump to export the entire database data, then use mysql < all.sql to import it back in.

| username: tidb狂热爱好者 | Original post link

I feel that TiDB should come up with a solution to prevent writing to MySQL system tables.

| username: tidb狂热爱好者 | Original post link

In the future, I will be more careful. When not using DM for migration, there are still many things to pay attention to. A small mistake can lead to an accident.

| username: Min_Chen | Original post link

This is expected behavior. It is recommended to use TiDB’s official tools for export and import, which come with a built-in system library filter.

| username: tidb狂热爱好者 | Original post link

Okay, I’ll try the official TiDB tools.

| username: system | Original post link

This topic was automatically closed 1 minute after the last reply. No new replies are allowed.