Solution for Errors When Importing the 'user' Table from TiDB to MySQL

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

Original topic: tidb导入mysql错误user表的解决方法

| username: tidb狂热爱好者

【TiDB Usage Environment】Production Environment
【TiDB Version】6

【Encountered Problem】
Unable to grant permissions to the existing table
【Reproduction Path】What operations were performed to cause the problem
The root user was deleted by the user. The user then added a root user again. But found that the root user is not functioning properly. The issue is that it cannot grant permissions to users.
mysql> GRANT all privileges ON . TO ‘dba’@localhost;
ERROR 1045 (28000): Access denied for user ‘root’@‘127.0.0.1’ (using password: YES)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

【Problem Phenomenon and Impact】

【Solution】

update user set Host=‘localhost’,select_priv=‘y’, insert_priv=‘y’,update_priv=‘y’,Alter_priv=‘y’,delete_priv=‘y’,create_priv=‘y’,drop_priv=‘y’,reload_priv=‘y’,shutdown_priv=‘y’,Process_priv=‘y’,file_priv=‘y’,grant_priv=‘y’,References_priv=‘y’,index_priv=‘y’,create_user_priv=‘y’,show_db_priv=‘y’,super_priv=‘y’,create_tmp_table_priv=‘y’,Lock_tables_priv=‘y’,execute_priv=‘y’,repl_slave_priv=‘y’,repl_client_priv=‘y’,create_view_priv=‘y’,show_view_priv=‘y’,create_routine_priv=‘y’,alter_routine_priv=‘y’,create_user_priv=‘y’,event_priv=‘y’,trigger_priv=‘y’,create_tablespace_priv=‘y’ where user=‘root’;

【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: Min_Chen | Original post link

Thank you for the analysis and solution. Throwing flowers~

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

Thank you for your reply. I hope it can help you.

| username: system | Original post link

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