O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Full backup of all databases

This can be done with the following:

shell> mysqldump --all-databases > dump.sql

The --all-databases option takes a backup of all databases and all tables. The > operator redirects the output to the dump.sql file. Prior to MySQL 8, stored procedures and events were stored in the mysql.proc and mysql.event tables. From MySQL 8 onward, definitions for corresponding objects are stored in data dictionary tables, but those tables are not dumped. To include stored routines and events in a dump made using --all-databases, use the --routines and --events options

To include the routines and events:

shell> mysqldump --all-databases --routines --events > dump.sql

You can open the dump.sql file to see how it is structured. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required