mysqldump Backup Error: mysqldump: Got error: 1449: The user specified as a definer (‘xxx’@’%’) does not exist when using LOCK TABLES

1. Find XXX user and find that it does not exist

select user,host from mysql. user;

The XXX user who created the view before has been deleted

2. Find these views and modify the definer information

select concat(“alter_definer=`root`@`%` view “, table_name, ” as “, view_definition, “;”)
from information_ schema. views
where table_schema='< Your database name> ‘;

The above SQL will generate a statement to modify the definer, which can be executed

Similar Posts: