Error when recovering MySQL data using xtrabackup: Original Data directory is not empty! At/usr/bin/innobackupex Line 568.
There are only two reasons for this imagination to be said on the Internet, and there is a third reason I have encountered:
1. Restore the backup file to ensure that the MySQL data directory is empty, otherwise it will be an error, the workaround:
#/etc/init.d/mysqld Stop # cd/usr/local/mysql # CP-RF Data{,.bak} # RM-RF./data/*
The 2.data directory is empty because the MY.CNF path is not specified when recovering data, the workaround:
Innobackupex--defaults-file=/etc/my.cnf--user=root--password=123123--copy-back/opt/backupdb/2016-04-25_ 15-54-13/
Note: To put the –defaults-file=/etc/my.cnf at the top of the command, otherwise it will error, let you put this parameter to the front
3. The above is not a problem, it may be because the MY.CNF does not specify the path of the data directory caused by the workaround:
# VI/ETC/MY.CNF [mysqld] DataDir =/use/local/mysql/data
This article is from the "Dream to Reality" blog, please be sure to keep this source http://lookingdream.blog.51cto.com/5177800/1905239
Xtrabackup restore MySQL data when error: Original Data directory is not empty!