今天在学习mysql 备份的时候,使用mysqldump 工具备份数据库的时候出现如下错误:
mysqldump: Error 1194: Table 'id_csv1' is marked as crashed and should be repaired when dumping table `id_csv1` at row: 0
这个表说明下:应该当时测试外部csv数据导入csv存储引擎表中,笔者直接将csv数据写入到data目录下,可能导致了破坏了这个表,然后出现这个错误。
问题解决:
登录数据库进行修复
id_csv1表:
root@localhost 14:23:55 ttt> repair table id_csv1;
+------------------+--------+----------+---------------------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+------------------+--------+----------+---------------------------------------------------------------+
|
ttt.id_csv1 | repair | Warning | Incorrect string value: '\xA2' for column 'username' at row 1 |
|
ttt.id_csv1 | repair | status | OK |
+------------------+--------+----------+---------------------------------------------------------------+
2 rows in set (0.02 sec)
重新备份数据库:
mysql>$ mysqldump -uroot -p'1234' -S /data/mysql/3306/mysql.sock ttt > /tmp/ttt_dump1.sql
阅读(3039) | 评论(0) | 转发(0) |