Skip to content

Instantly share code, notes, and snippets.

@zarulizham
Created April 11, 2024 03:11
Show Gist options
  • Save zarulizham/928bcb17027692786349b260fb611d93 to your computer and use it in GitHub Desktop.
Save zarulizham/928bcb17027692786349b260fb611d93 to your computer and use it in GitHub Desktop.

BACKUP

mysqldump -hHOST -uUSER -p DATABASE_NAME > backup.sql

Remove definer

sed -i 's/\sDEFINER=`[^`]*`@`[^`]*`//' backup.sql

Restore

mysql -uUSER -p DATABASE_NAME < backup.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment