nerdexam
Oracle

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…

Backup and Recovery

Question

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 application user, but fail as follows: mysql -u application -p ERROR 1045 (28000): Access denied for user 'application'@'localhost' (using password: YES) The login works on the master. Which two changes to the process can fix the issue?

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)
  • A
    13% (2)
  • B
    7% (1)
  • C
    73% (11)
  • D
    7% (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-databases includes the mysql database by default.
  • D is wrong - there is no standard --grants option in mysqldump; that flag belongs to third-party tools like Percona's pt-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

#mysqldump limitations#mysql system database#user privileges#replication backup

Community Discussion

No community discussion yet for this question.

Full 1Z0-888 Practice