nerdexam
Oracle

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…

Backup and Recovery

Question

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 extra instances having their own separate my.cnf file (for example /etc/mysql/instanceN.cnf) overriding the defaults. A restore of the second instance is attempted from the mysqlbackup archive using this command: mysqlbackup --backup-dir=/opt/backup/mysql/instance2 copy-back Upon starting the second MySQL instance, you notice that the data does not match the expected backup. Which command-line option is required to successfully update the second instance?

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)
  • A
    2% (1)
  • B
    6% (3)
  • C
    2% (1)
  • D
    13% (7)
  • E
    77% (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 valid mysqlbackup options - 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 is copy-back, which is already in the command.
  • C (--backup-instance=...) does not exist in mysqlbackup; 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

#mysqlbackup#restore operations#multi-instance setup#--defaults-file

Community Discussion

No community discussion yet for this question.

Full 1Z0-888 Practice