Skip to content

Instantly share code, notes, and snippets.

@divinity76
Last active March 6, 2020 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save divinity76/6a6bb779101e9f6c27e51eefb02f3ed9 to your computer and use it in GitHub Desktop.
Save divinity76/6a6bb779101e9f6c27e51eefb02f3ed9 to your computer and use it in GitHub Desktop.
mysqldump example
TODO: filter out the ??string?? stuff
??--order-by-primary??
??--apply-slave-statements??
??--default-character-set=utf8mb4??
mysqldump --user=user_name --password --quick --insert-ignore --port=port_num --host=host_name --all-databases --no-autocommit --compress --add-locks --single-transaction --all-tablespaces --quote-names --allow-keywords --comments --complete-insert --create-options --dump-date --events --extended-insert --hex-blob --routines --set-charset
$cmd = implode(" ", array(
'mysqldump',
'--user=' . escapeshellarg($db_creds->dbuser),
'--password=' . escapeshellarg($db_creds->dbpass),
'--host=' . escapeshellarg($db_creds->dbhost),
// '--port=port_num',
'--quick',
'--insert-ignore',
'--all-databases',
'--no-autocommit',
'--compress',
'--add-locks',
'--single-transaction',
'--all-tablespaces',
'--quote-names',
'--allow-keywords',
'--comments',
'--complete-insert',
'--create-options',
'--dump-date',
'--events',
'--extended-insert',
'--hex-blob',
'--routines',
'--set-charset',
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment