FreeKB - mySQL / MariaDB Back up database (mysqldump)
mySQL / MariaDB - Back up database (mysqldump)

The mysqldump command can be used to backup one or more MySQL or MariaDB databases.

To backup a single database:

mysqldump -u username -p password --databases database_name > /path/to/directory/backup.sql

 

The --all-databases option can be used to backup every database.

mysqldump -u username -p password --all-databases > /path/to/directory/backup.sql

 

The gzip option can be included to create a gzip compressed file.

mysqldump -u username -p password --all-databases | gzip > /path/to/directory/backup.sql

 

The backup.sql file will contain all of the commands that are needed to recreate the tables in the database, and to insert all of the data into the tables.



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter 42963 in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |