1Z0-888 · Question #46
There are multiple instances of MySQL Server running on a single OS that is backed up using the mysqldump command. The /etc/my.cnf contains default values, for example, datadir=/var/lib/mysql/, with…
The correct answer is E. --defaults-file=/etc/mysql/instance2.cnf. Option E is correct because mysqlbackup, like all MySQL utilities, reads /etc/my.cnf by default when no config file is specified. Without --defaults-file, the restore command targets the first instance's datadir and settings - not instance2's - causing the data to land in the…
Question
Options
- A--restore=2
- B--copy-back-from-log
- C--backup-instance=/var/lib/mysql/instance2
- D--instance=/var/lib/mysql/instance2
- E--defaults-file=/etc/mysql/instance2.cnf
How the community answered
(53 responses)- A2% (1)
- B6% (3)
- C2% (1)
- D13% (7)
- E77% (41)
Explanation
Option E is correct because mysqlbackup, like all MySQL utilities, reads /etc/my.cnf by default when no config file is specified. Without --defaults-file, the restore command targets the first instance's datadir and settings - not instance2's - causing the data to land in the wrong location or the wrong instance to be configured entirely. Passing --defaults-file=/etc/mysql/instance2.cnf explicitly tells mysqlbackup which instance's configuration (port, socket, datadir, etc.) to use for the operation.
Why the distractors are wrong:
- A (
--restore=2) and D (--instance=...) are not validmysqlbackupoptions - they are invented distractors with no corresponding functionality. - B (
--copy-back-from-log) is also a fabricated option; the real subcommand for restoring from a backup iscopy-back, which is already in the command. - C (
--backup-instance=...) does not exist inmysqlbackup; you cannot point to an instance by data directory path this way.
Memory tip: Any time a MySQL tool behaves unexpectedly in a multi-instance setup, the fix is almost always --defaults-file. Think of it as: "Which instance am I talking to?" - if you don't specify, MySQL tools always assume the default (first) instance.
Topics
Community Discussion
No community discussion yet for this question.