Skip to content

Instantly share code, notes, and snippets.

@grimzy
Created March 20, 2018 19:28
Show Gist options
  • Save grimzy/ac4f33589e304f4c293aee76fc9c58d2 to your computer and use it in GitHub Desktop.
Save grimzy/ac4f33589e304f4c293aee76fc9c58d2 to your computer and use it in GitHub Desktop.
Portable MySQL dump
mysqldump database_name > database_dump.sql
sed -E 's/DEFINER=`[^`]+`@`[^`]+`/DEFINER=CURRENT_USER/g' database_dump.sql > portable_database_dump.sql
@grimzy
Copy link
Author

grimzy commented Mar 20, 2018

For when we try to import a MySQL dump and get the following error: The user specified as a definer ('srv_master'@'localhost') does not exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment