May 2005
Intermediate to advanced
352 pages
14h 39m
English
RESTORE TABLE
RESTORE TABLEtable[, . . . ] FROM '/path'
Use this statement to restore 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 is given 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.
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 was successful in restoring the .frm and .MYD files located in the backup directory. The .MYI files were generated automatically after they were restored.
Read now
Unlock full access