Backing up all tables

If you want to back up all your MySQL databases at once (including the system databases such as mysql), you can use a command such as the next one, which would enable you to restore an entire MySQL database installation. Remember to use locking where required.

Use next command in terminal, do not use in mysql client.
Dumping all the MySQL databases to file:
Mariadb command is:
mysqldump -u user -p password -A > all_databases.sql
or mysql command is:
mysqldump -u user -p –all-databases > all_databases.sql

Of course, there’s a lot more than just a few lines of SQL code in
backed-up database files. I recommend that you take a few minutes
to examine a couple in order to familiarize yourself with the types
of commands that appear in backup files and how they work.

Leave a Reply

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