1Z0-908 · Question #30
1Z0-908 Question #30: Real Exam Question with Answer & Explanation
The correct answer is D. mysql> IMPORT TABLE FROM /var/tmp/customers.sdi G. mysql> ALTER TABLE shop.customers IMPORT TABLESPACE. Note: The stated correct answers (D, G) appear to contain an error. Option G - ALTER TABLE shop.customers IMPORT TABLESPACE - is an InnoDB-specific command and has no meaning for a MyISAM table. The actual correct answers for this question should be A and D. --- In MySQL 8.0, the
Question
Options
- Ashell> cp /backup/customers.sdi /var/tmp
- Bshell> cp /backup/customers.sdi /var/lib/mysql/shop/
- Cmysql> SOURCE `/var/tmp/customers.sdi'
- Dmysql> IMPORT TABLE FROM /var/tmp/customers.sdi
- Eshell> cp /backup/customers.frm /var/lib/mysql/shop/
- Fmysql> IMPORT TABLE FROM /var/lib/mysql/shop/customers.sdi
- Gmysql> ALTER TABLE shop.customers IMPORT TABLESPACE
- Hmysql> ALTER TABLE shop.customers DISCARD TABLESPACE
Explanation
Note: The stated correct answers (D, G) appear to contain an error. Option G - ALTER TABLE shop.customers IMPORT TABLESPACE - is an InnoDB-specific command and has no meaning for a MyISAM table. The actual correct answers for this question should be A and D.
In MySQL 8.0, the IMPORT TABLE statement restores MyISAM tables using .sdi (Serialized Dictionary Information) files, which replaced the old .frm format. The .MYD (data) and .MYI (index) files were already copied to the datadir in step 3, but the .sdi definition file must be placed in the secure_file_priv directory (/var/tmp) before IMPORT TABLE can read it - making A and D the required steps.
Why distractors fail:
- B/F: Placing
.sdiin the datadir directly or referencing it there bypassessecure_file_priv- MySQL requires the.sdito come from that restricted path. - C:
SOURCEexecutes SQL scripts, not.sdibinary/JSON files. - E:
.frmfiles are MySQL 5.x - MySQL 8.0 uses.sdi; copying a.frmdoes nothing. - G/H:
IMPORT TABLESPACE/DISCARD TABLESPACEare InnoDB concepts (.ibdfiles); MyISAM has no tablespace.
Memory tip: For MyISAM in MySQL 8.0, think "sdi to tmp, then IMPORT TABLE" - the .sdi goes to secure_file_priv, then IMPORT TABLE FROM that path registers the table definition. IMPORT TABLESPACE = InnoDB only.
Topics
Community Discussion
No community discussion yet for this question.