TiDB crashed after importing the MySQL database into the new MySQL database before exporting

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

Original topic: tidb导出之前mysql库导入新mysql库之后崩掉了

| username: 舞动梦灵

I used mysqldump to export a MySQL database from another TiDB and then imported it into a new database. As a result, all users failed to log in.



How to restore users or recreate users?

| username: Soysauce520 | Original post link

Is it importing TiDB to TiDB? Are the versions the same?

| username: Miracle | Original post link

Do I need to flush it?

| username: zhanggame1 | Original post link

The root user will not be overridden, right? You can log in as the root user in real-time and reset the passwords of other accounts.

| username: 舞动梦灵 | Original post link

I searched for a solution on Baidu. In conf/tidb.toml, similar to MySQL, I added a skip option to bypass empty password login. After logging in, I found that there was no data in the MySQL user table. I tried to insert data into the user table manually, but the insertion failed. I suspect that the table was recreated during the mysqldump import, but the data insertion failed, which is why no one can log in.

| username: zhanggame1 | Original post link

You can use Dumpling to export and Lightning to import in TiDB. Can the root user log in?

| username: 舞动梦灵 | Original post link

I was already annoyed with having to use BR and CDC after downloading them, and I haven’t even mastered these two yet. Now, there’s this Dumpling thing. Forget it. The issue has been resolved. The import failure was because there was a password column that was auto-generated and couldn’t be inserted or modified. When I inserted data into the user table and ignored this column, it automatically filled in based on another password column, keeping the password unchanged.

| username: zhanggame1 | Original post link

Dumpling is quite similar to the built-in MySQL export tool and is very simple to use.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.