Name
RESTORE TABLE
Synopsis
RESTORE TABLEtable[, ...] FROM '/path'
This statement restores a table that was saved to the
filesystem by the BACKUP TABLE statement.
Multiple tables may be given in a comma-separated list.
The absolute path to the directory containing the backup files must
appear within quotes. If the tables already exist in the database, an
error message will be generated and the restore will fail. If it’s
successful, the table indexes will be built automatically. This is
necessary because the BACKUP TABLE statement
doesn’t back up the index files. Here is an example of this statement:
RESTORE TABLE clients, programmers FROM '/tmp/backup'; +--------------------------+---------+----------+----------+ | Table | Op | Msg_type | Msg_text | +--------------------------+---------+----------+----------+ | workrequests.clients | restore | status | OK | +--------------------------+---------+----------+----------+ | workrequests.programmers | restore | status | OK | +--------------------------+---------+----------+----------+
In this example, the statement is successful in restoring the .frm and .MYD files located in the backup directory and regenerating the .MYI files.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access