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

MySQL/MariaDB, How to Restore

MySQL/MariaDB logo

Restoring MySQL is as simple as running the 'mysql' command from the backup file and restoring the database data.

The same is true for MariaDB.

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

The backup files used to restore the database are easy to create.

Backup files should be made periodically. I mean, a database that doesn't do this is dangerous.

And when something happens, run the restore command.

mysql -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



Enter the contents of the backup.sql file into the 'mysql' command in the redirection to update the contents of the database.

Leave a Reply

*