Importing SQL files
Any file containing MySQL statements can be imported via this mechanism. This format is the more commonly used for backup/restore purposes. The dialog is available in the Server
view, Database
view, or the Table
view, via the Import page, or in the Query window.
Note
There is no relation between the currently selected table (here author) and the actual contents of the SQL file that will be imported. All the contents of the SQL file will be imported, and it is those contents that determine which tables or databases are affected. However, if the imported file does not contain any SQL statements to select a database, all statements in the imported file will be executed on the currently selected database.
Let us try an import exercise. First, we make sure that we have a current SQL export file of the book
table (as explained in Chapter 6). This export file must contain the structure and the data. Then we drop the book
table—yes, really! We could also simply rename it. (Refer...