Xtrabackup restore MySQL data when error: Original Data directory is not empty!

Source: Internet
Author: User

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.