Think before you speak, read before you think.

mysqldump备份时出现问题

使用mysqldump备份时,–opt表示采用优化(Optimize)方式

mysqldump --opt -uroot -ppasswd c14sql >c14sql.sql

出现错误

mysqldump: Got error: 145: Table './c14sql/is_stats' is marked as crashed and should be repaired when using LOCK TABLES

解决办法1,用myisamchk

myisamchk -c -r /var/lib/mysql/c14sql/is_stats.MYI

解决办法2,进入mysql>(暂未测试)

mysql> repair table is_stats;

检测一下

mysql> check tables is_stats;

没问题的话再备份就没有问题了

ps:

mysqldump 导出表结构 –no-data flag to make it only export structure

mysqldump -u jira -p -h 192.168.9.11 jira6 --no-data > jira6.nodata.sql

 


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *