Hello all,
I'm a newbie to MySQLEnterprise Backup.
I have a test database that I have backed up using the following command:
mysqlbackup --backup-dir=/u01/mysql_backups --with-timestamp --user=uname --password=pwd backup-and-apply-log
The backup ran successfully.
I want to test a restore. So I deleted the data files for the database that were backed up. There are datafiles and innodb files that I deleted with an OS command after shutting down the mysql instance.
From /etc/my.cnf:
datadir=/u01/mysql_data_files
innodb_data_home_dir = /u01/mysql_innodb_data_files
I deleted all files in /u01/mysql_data_files and /u01/mysql_innodb_data_files
Now, I'm trying to restore the database from the backup.
The files were backed up to a directory named:
/u01/mysql_backups/2013-02-11_08-53-47 becuase I used the --with-timestamp parameter
Here is the restore command I am attempting and the errors I am receiving:
mysqlbackup --defaults-file=/u01/mysql_backups/2013-02-11_08-53-47/backup-my.cnf --backup-dir=/u01/mysql_backups/2013-02-11_08-53-47 copy-back
MySQL Enterprise Backup version 3.8.0 [2012/07/27]
Copyright (c) 2003, 2012, Oracle and/or its affiliates. All Rights Reserved.
mysqlbackup: INFO: Starting with following command line ...
mysqlbackup
--defaults-file=/u01/mysql_backups/2013-02-11_08-53-47/backup-my.cnf
--backup-dir=/u01/mysql_backups/2013-02-11_08-53-47 copy-back
IMPORTANT: Please check that mysqlbackup run completes successfully.
At the end of a successful 'copy-back' run mysqlbackup
prints "mysqlbackup completed OK!".
mysqlbackup: ERROR: Missing datadir parameter for server repository.
mysqlbackup: ERROR: Server repository configuration problem found.
I'm curious about the --defaults-file parameter, should that be the backup copy of the my.cnf file which the backup made? It currently resides in the backup directory /u01/mysql_backups/2013-02-11_08-53-47 and is named backup-my.cnf
Second, the --backup-dir parameter, should that include the entire name of the backup directory right down to the /u01/mysql_backups/2013-02-11_08-53-47 part as shown above or just the main directory that I used when issuing the bacup command /u01/mysql_bacukps?
Can somone give me an idea what the two errors are above and how to get around them to restore the database?
My /etc/my.cnf file has the following
[mysql@eiawwwdb01 mysql_backups]$ cat /etc/my.cnf
# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
#
http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
datadir=/u01/mysql_data_files
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
# Replication Master Server (default)
# binary logging is required for replication
log-bin=/u01/mysql_binlog_files/mysql-binlog
# binary logging format - mixed recommended
binlog_format=mixed
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1
# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = /u01/mysql_innodb_data_files
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /u01/mysql_innodb_data_files
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
innodb_support_xa = 1