1Z0-888 · Question #88
You have just created a replication slave from a backup of the master made with mysqldump: mysqldump -u backup -p --all-databases > /backups/mysql.sql You try to log in to the slave with the…
The correct answer is C. Add a second dump for the 'mysql' database; --all-databases does not include it. Option C's premise is actually technically incorrect - mysqldump --all-databases does include the mysql system database, which holds user/privilege tables. This appears to be a flawed answer key; the real correct pair is A and B. When you restore a mysqldump that includes the…
Question
Options
- AAfter the restore, log in to the database and execute FLUSH PRIVILEGES.
- BUse the -flush-privileges with mysqldump.
- CAdd a second dump for the 'mysql' database; --all-databases does not include it.
- DUse the -grants option to include GRANT statements in the dump.
How the community answered
(15 responses)- A13% (2)
- B7% (1)
- C73% (11)
- D7% (1)
Explanation
Option C's premise is actually technically incorrect - mysqldump --all-databases does include the mysql system database, which holds user/privilege tables. This appears to be a flawed answer key; the real correct pair is A and B.
When you restore a mysqldump that includes the mysql database, user grants are inserted directly into the grant tables (via INSERT statements, not GRANT statements). MySQL caches privilege data in memory, and that in-memory cache is not automatically refreshed after a raw table restoration. Running FLUSH PRIVILEGES (option A) forces MySQL to reload the grant tables into memory, fixing the access denial. Option B (--flush-privileges) achieves the same result automatically by appending a FLUSH PRIVILEGES statement at the end of the dump file itself, so it runs on restore.
Why the others are wrong:
- C is factually wrong -
--all-databasesincludes themysqldatabase by default. - D is wrong - there is no standard
--grantsoption inmysqldump; that flag belongs to third-party tools like Percona'spt-show-grants.
Memory tip: Think "direct table write = stale cache." Whenever you bypass GRANT statements and write directly to MySQL's privilege tables (as mysqldump restore does), you must FLUSH PRIVILEGES to sync memory with disk - either manually after restore (A) or baked into the dump (B).
Note: If your exam marks C as the sole correct answer, it is likely an error in the question bank. Flag it if you have the opportunity.
Topics
Community Discussion
No community discussion yet for this question.