3/20/2021 0 Comments Reading Sql Dump Files
If you lose your data in MariaDB, but have been using mysqldump to make regular backups of your data in MariaDB, you can use the dump files to restore your data.To restore a dump file, its just a matter of having the mysql client execute all of the SQL statements that the file contains.
There are some things to consider before restoring from a dump file, so read this section all of the way through before restoring. One simple and perhaps clumsy method to restore from a dump file is to enter something like the following. The mysqldump utility is only for making back-up copies, not restoring databases. Instead, you would use the mysql client, which will read the dump files content in order to batch execute the SQL statements that it contains. Notice that the redirect for STDOUT is not used here, but the redirect for the standard input ( STDIN ); the less-than sign is used since the dump file is an input source. You may want to stop MariaDB before doing a restore, and then start it again when done. For instance, your dump file might be a few days old and only one table may have been lost. If you restore all of the databases or all of the tables in a database, you would be restoring the data back to its state at the time of the backup, a few days before. Now when you restore the dump file containing the whole db1 database, only table1 will be replaced with the back-up copy. ![]() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |