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

The following command takes a backup of all databases into the /backups folder:

shell> mydumper -u root --password=<password> --outputdir /backups

Several files are created in the /backups folder. Each database has its CREATE DATABASE statement as <database_name>-schema-create.sql and each table will have its own schema and data files. Schema files are stored as <database_name>.<table>-schema.sql and data files are stored as <database_name>.<table>.sql.

The views are stored as <database_name>.<table>-schema-view.sql. Stored routines, triggers, and events are stored as <database_name>-schema-post.sql (use sudo mkdir –pv /backups if directory is not created):

shell> ls -lhtr /backups/company*-rw-r--r-- 1 root root 69 Aug 13 10:11 ...

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