使用Xtrabackup恢复mysql数据时候报错:Original data directory is not empty! at /usr/bin/innobackupex line 568. 网上普遍只说了引起这种想象的两种原因,还有第三种原因是我遇到的: 1.恢复备份文件要保证mysql的data目录为空,否则会报错,解决办法: # /etc/init.d/mysqld stop # cd /usr/local/mysql # cp -rf data{,.bak} # rm -rf .
向mysql数据库中导入sql文件时,如果文件过大(几百M),会提示"Error Code: 1153 - Got a packet bigger than 'max_allowed_packet' bytes" 1.查看目前数据库配置 show VARIABLES like '%max_allowed_packet%'; 显示如下结果 +--------------------+---------+ | Variable_name | Value | +--------
参考:http://stackoverflow.com/questions/93128/mysql-error-1153-got-a-packet-bigger-than-max-allowed-packet-bytes 用脚本写测试数据,在ubuntu上ok,没想到到centos报1153错误.解决方法: 登入mysql,执行: set global net_buffer_length=1000000; set global max_allowed_packet=1000000000; 就ok