【MySQL学习笔记】innobackupex还原时报错Original data directory './' is not empty! line 590
来源:互联网 发布:英文输入法软件 编辑:程序博客网 时间:2024/05/01 06:50
innobackupex命令还原时报错。
报错信息如下:
[mysql@ggg2 ~]$ innobackupex --defaults-file=/data/mysqldata/backup/2016-10-16_21-47-35/backup-my.cnf --copy-back /data/mysqldata/backup/2016-10-16_21-47-35InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oyand Percona Ireland Ltd 2009-2012. All Rights Reserved.This software is published underthe GNU GENERAL PUBLIC LICENSE Version 2, June 1991.IMPORTANT: Please check that the copy-back run completes successfully. At the end of a successful copy-back run innobackupex prints "completed OK!".Original data directory './' is not empty! at /usr/local/percona-xtrabackup-2.0.7/bin/innobackupex line 590.
1、在网上也找到一些类似错误的解决办法,但是都无效。
命令中通过 --defaults-file选项,指定了参数文件(备份的):/DATA/mysqldata/BACKUP/2016-10-16_21-47-35/BACKUP-my.cnf
于是查看了参数文件,内容如下:
# This MySQL options file was generated by innobackupex.# The MySQL server[mysqld]innodb_data_file_path=ibdata1:2048M:autoextendinnodb_log_files_in_group=3innodb_log_file_size=134217728innodb_page_size=16384innodb_undo_tablespaces=0
额,被innobackupex命令备份的参数文件给坑了,竟然没有datadir参数。
于是加了一行:datadir=/data/mysqldata/3306/data
再次运行命令,还是报错:
Original data directory '/data/mysqldata/3306/data' does not exist! at /usr/local/percona-xtrabackup-2.0.7/bin/innobackupex line 586.
[mysql@ggg2 ~]$ mkdir -p /data/mysqldata/3306/data[mysql@ggg2 ~]$ ls -al /data/mysqldata/3306总用量 12drwxrwxr-x. 3 mysql mysql 4096 10月 18 22:44 .drwxr-xr-x. 7 mysql mysql 4096 10月 18 22:44 ..drwxrwxr-x. 2 mysql mysql 4096 10月 18 22:44 data
3、再次执行命令,还是报错了,不过这次是空间不足:
innobackupex: Error: copy failed: 设备上没有空间 at /usr/local/percona-xtrabackup-2.0.7/bin/innobackupex line 386.
看了一下,确实是没有剩余空间了,使用率100%了:
[root@ggg2 Desktop]# df -lhFilesystem Size Used Avail Use% Mounted on/dev/sda3 16G 15G 0 100% /tmpfs 936M 228K 936M 1% /dev/shm/dev/sda1 194M 36M 148M 20% /boot
删了一些不需要的文件之后,再次执行命令,就成功了,这样就把之前所备份的文件还原到 数据目录中了:
161018 22:55:37 innobackupex: completed OK!
4、把参数文件复制到原来的目录:
[mysql@ggg2 ~]$ cp /data/mysqldata/backup/2016-10-16_21-47-35/backup-my.cnf /data/mysqldata/3306/my.cnf
然后,再my.cnf文件上再加上:
basedir = /usr/local/mysqlsocket = /data/mysqldata/3306/mysql.sockpid-file = /data/mysqldata/3306/mysql.pidtmpdir = /data/mysqldata/3306/tmp
5、接下来,启动mysql,不过报错了,说tmp目录不存在,然后接着创建tmp目录,不过还是回报错:
2016-10-18 23:22:40 22909 [ERROR] InnoDB: auto-extending data file /data/mysqldata/3306/data/ibdata1 is of a different size 20163 pages (rounded down to MB) than specified in the .cnf file: initial 131072 pages, max 0 (relevant if non-zero) pages!6、一开始没有明白为什么会报这个错误,后来才发现,原来是mysql发现在数据目录下没有发现 ibdata,所以又新建了一个ibdata文件,于是就报那个错误了,于是接下来把ibdata文件和ib_logfile文件拷贝到数据目录下,启动mysql,恢复正常。
0 0
- 【MySQL学习笔记】innobackupex还原时报错Original data directory './' is not empty! line 590
- innobackupex: Error: Original data directory '.' is not empty
- remove a directory which is not empty
- directory "*" exists but is not empty
- Error “Cannot Delete folder: The directory is not empty” Fix
- rm: 0653-611 Directory xxxxx is not empty
- iOS: Directory not empty
- redis学习之集群报错Node is not empty
- redis学习之集群报错Node is not empty
- redis学习之集群报错Node is not empty
- redis学习之集群报错Node is not empty
- Warring the /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' user
- 使用innobackupex备份时报错
- 安装PostgreSQL出现“Invalid username specified:登录失败:未知的用户名和错误密码。”和“The specified data directory is not empty.”错误的解决方案
- mysql无法开启:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql'
- 启动mysql 失败,“Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' ”
- mysql无法开启:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql'
- mac mysql没法启动 Waring:The /usr/local/mysql/data directory is not owned by the mysql/_mysql
- angularjs: ng-select和ng-options
- 基于CPLD和LVPECL门电路的脉宽可调窄脉冲信号发生器设计
- IO设计模式:Reactor和Proactor对比
- Mac Golang 相关
- 机器学习算法(优化)之二:期望最大化(EM)算法
- 【MySQL学习笔记】innobackupex还原时报错Original data directory './' is not empty! line 590
- i2c设备驱动probe函数中platform_data
- ++i和i++哪个效率高
- 深入理解javascript原型和闭包(5)——instanceof
- dockerfile 多端口映射 expose
- 车道线检测的相关算法 keywords
- opencl处理的基本流程
- HTML5 sessionStorage和localStorage
- Device eth0 does not seem to be present”解决办法 (常见于克隆系统后出现的网络配置问题)