Tweet
Share
Send by LINE
B! Bookmarks in Hate-bu
Bookmarks in Pocket
RSS feeds

MySQL/MariaDB, How to backup

MySQL/MariaDB logo

The method of backing up MySQL is simple, just run the 'mysqldump' command.

It's the same with MariaDB.

This is written by a Japanese who can't speak English with the help of translation application. Sorry if it's not good.

Run the following command

mysqldump -uuser -ppassword db_name > backup.sql
userDB Connection User
passwordDB connection password
db_nameDatabase Name
backup.sqlBackup File Name

Options

-u

Database connection user name

-p

Database connection password



Redirect the 'mysqldump' command and write the backup contents to the backup.sql file.

Use this backup.sql to restore the database.

Leave a Reply

*