Skip to content

Instantly share code, notes, and snippets.

@radub
Last active October 10, 2018 07:35
Show Gist options
  • Save radub/7f60a9c4848cbee14131c67fd47bd38b to your computer and use it in GitHub Desktop.
Save radub/7f60a9c4848cbee14131c67fd47bd38b to your computer and use it in GitHub Desktop.
# enable logging to file
SET GLOBAL log_output = "FILE";
SET GLOBAL general_log_file = "/tmp/q_logfile.log";
SET GLOBAL general_log = 'ON';
# dump database
mysqldump --routines --single-transaction -q --add-drop-table --create-options --add-drop-database --disable-keys --extended-insert --set-charset {database_name} | gzip > {database_name}.sql.gz
# remove definer
perl -p -i.bak -e "s/DEFINER=[^ |\s]*//g" dbdumpfile.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment