MySQL Forums
Forum List  »  Backup

Help for restore
Posted by: John Sebastian
Date: February 11, 2013 03:02PM

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:
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 ...
--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:
# 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
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
port = 3306
socket = /var/lib/mysql/mysql.sock
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

# 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!

# Replication Master Server (default)
# binary logging is required for replication

# binary logging format - mixed recommended

# 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

Options: ReplyQuote

Written By
Help for restore
February 11, 2013 03:02PM
February 12, 2013 08:25AM
March 15, 2013 02:26AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.