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
user | DB connection user |
password | DB connection password |
db_name | Database Name |
backup.sql | Backup 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.