A Workaround for mysqldump Error 1449
Trying to dump mysql databases (especially after mysql 5.1), it is possible to get the error
mysqldump: Got error: 1449: The user specified as a definer ('root'@'%') does not exist when using LOCK TABLES
(another user may appear instead of 'root' and another address or IP instead of '%' )
This error is produced, because MySQL (latest 5.*
versions) exports DEFINER with views or procedures,
which might be not the same in production (usually a
common mysql user) and developer machines (usually user
These lines in
mysqldump files start with 50013
/*!50013 DEFINER=`some_user`@`some_host` SQL SECURITY DEFINER */
As far as I know, there is not yet a flag for
avoid DEFINER export. So, a solution is to replace
The dump file can be imported afterwards to the developer machine.
Hope to find it helpful. Your comments are welcomed!