To import our saved books.sql file created earlier, we’d use many of the same flags and much the same syntax. In most cases, importing is just a matter of passing virtually identical options to the mysqlimport command. ![]() Now that you’ve learned how to export a backup of a MySQL database, we’ll explore how to reverse the process and import the backup into an existing database.Īs you might imagine, to compliment the mysqldump command used for exporting, there is a similar mysqlimport command for importing. It will execute all the SQL statements in the file, which rebuilds the. If you need the ability to export (and later recreate) one more more databases, read up on the -databases flag in the official documentation. In either case, the text file will be imported back into a MySQL database server. Instead, by default, only actual tables (and their respective data) are saved and thus will be prepared for later import using this file. sql suffix (which is completely optional but advisable) in the appropriate directory.īy default, mysqldump will not save commands which attempt to modify the existence of the actual database.
0 Comments
Leave a Reply. |