Solve the error of database'information_schema'" when using LOCK TABLES when backing up the database

1. Error when backing up data

mysqldump: Got error: 1044: "Access denied for user 'root'@'localhost' to database 'information_schema'" when using LOCK TABLES
mysqldump: Got error: 1142: "SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'cond_instances'" when using LOCK TABLES

2. Solution

It can be solved by adding the --skip-lock-tables parameter after the mysqldump command.
Example:

mysqldump --skip-lock-tables  -B information_schema > /mysql/information_schema.sql

Guess you like

Origin blog.csdn.net/m0_46674735/article/details/112407786