innobackupex 使用--tables-file报 xtrabackup: `mysql.user...` name is too long 错误

最近使用innobackupex这个备份工具,使用了--tables-file参数,原命令如下:

/usr/bin/innobackupex --no-timestamp --user='xxx' --password='xxxx' --rsync --compress --compress-threads=5 --compress-chunk-size=64K --slave-info --tables-file=/data/deploy/mysql_backup/tables.txt /data/deploy/mysql_backup/backup_dir/full

报错:

IMPORTANT: Please check that the backup run completes successfully.
           At the end of a successful backup run innobackupex
           prints "completed OK!".

191101 11:26:49  version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;port=3306;mysql_socket=/var/run/mysqld/mysqld.sock' as 'bkpuser'  (using password: YES).
191101 11:26:49  version_check Connected to MySQL server
191101 11:26:49  version_check Executing a version check against the server...
191101 11:26:49  version_check Done.
191101 11:26:49 Connecting to MySQL server host: localhost, user: bkpuser, password: set, port: 3306, socket: /var/run/mysqld/mysqld.sock
Using server version 5.6.44-86.0-log
/usr/bin/innobackupex version 2.3.10 based on MySQL server 5.6.24 Linux (x86_64) (revision id: bd0d4403f36)
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /data/mysqldb
xtrabackup: open files limit requested 0, set to 655350
xtrabackup: using the following InnoDB configuration:
xtrabackup:   innodb_data_home_dir = ./
xtrabackup:   innodb_data_file_path = ibdata1:100M:autoextend
xtrabackup:   innodb_log_group_home_dir = /data/mysqldb/
xtrabackup:   innodb_log_files_in_group = 3
xtrabackup:   innodb_log_file_size = 268435456
xtrabackup: using O_DIRECT
xtrabackup: `mysql.user...` name is too long

 

发现mysql.user表长度,字段长度并无异常,且是mysql自动维护的表,不应该会有错误。

于是检查/data/deploy/mysql_backup/tables.txt文件,发现也并无异常,每行一个表。

经过测试发现每次都是最后一行的表名提示报错。于是查看 xtrabackup 源码:

发现xtrabackup工具对于每一行都会去查找“\n”, 即使是最后一行,也要求末尾有"\n",否则指定 --tables-file 参数就会报错。

于是在 生成的tables.txt内容最后一行添加"\n", 测试问题解决。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值