Skip to content

Instantly share code, notes, and snippets.

@martijngastkemper
Last active August 29, 2015 13:57
Show Gist options
  • Save martijngastkemper/9391764 to your computer and use it in GitHub Desktop.
Save martijngastkemper/9391764 to your computer and use it in GitHub Desktop.
Dump MySQL database and remove definer. Definer must be an existing user. So when moving a database to another server the trigger can fail when the definer doesn't exists.
mysqldump database-name | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' > output.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment