mysqldump

mysqldump is a command used to backup MySQL databases.

To take backup, run

To backup with triggers, routines, and events

–opt combines many options. It is same as adding –add-drop-table, –add-locks, –create-options, –disable-keys, –extended-insert, –lock-tables, –quick, and –set-charset.

–extended-insert option will group together all INSERT operations for a table. This makes the backup file smaller and makes restoration faster. I restored a mysqldump bakcup, it take me 2 hours to restore. Same database backup with –extended-insert option take only 10 minutes to restore. If you want a separate INSERT for each row, then use –skip-extended-insert or –complete-insert option

Backup All Databases

To backup all databases, run

To backup MySQL databases into separate files, run

If you need to compress the sql file. use

Backup Database Structure only

Backup Only routines

Related Posts

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *