最新消息:20181230 VPS服务器已从Linode换到腾讯云香港,主题仍用朋友推荐的大前端D8

【已解决】mysqldump导出数据库失败:Got error 144 Table wp_login_fails is marked as crashed

VirtualHost crifan 1147浏览 0评论

折腾:

【记录】crifan.com服务器换到fzhost.net

期间,结果

➜  public_html mysqldump -uroot -pxxxx linode_wordpress_db > crifan_wordpress_db_170613.sql
mysqldump: Got error: 144: "Table ‘./linode_wordpress_db/wp_login_fails’ is marked as crashed and last (automatic?) repair failed" when using LOCK TABLES

所以先去修复

Got error 144 Table wp_login_fails is marked as crashed

mysql table is marked as crashed and last (automatic?) repair failed – Stack Overflow

[SOLVED]mysqldump: Got error: 144: Table ‘./database_name/table_name’ is marked as crashed and last (automatic?) repair failed when using LOCK TABLES – Lin(ux+Win)dows!!!

结果:

想要进去修复table,结果由于:

drwxr–r– 2 mysql mysql 4.0K May 18 20:33 linode_wordpress_db

导致cd不进去

所以放弃。

结果repair出错:

MariaDB [(none)]> use linode_wordpress_db;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [linode_wordpress_db]> show tables;
+——————————-+
| Tables_in_linode_wordpress_db |
+——————————-+
| wp_commentmeta                |
| wp_comments                   |
| wp_evernote_sync_record       |
| wp_links                      |
| wp_lockdowns                  |
| wp_login_fails                |
| wp_options                    |
| wp_postmeta                   |
| wp_posts                      |
| wp_term_relationships         |
| wp_term_taxonomy              |
| wp_termmeta                   |
| wp_terms                      |
| wp_usermeta                   |
| wp_users                      |
+——————————-+
15 rows in set (0.00 sec)
MariaDB [linode_wordpress_db]> repair table wp_login_fails;
+————————————+——–+———-+———————————————————————–+
| Table                              | Op     | Msg_type | Msg_text                                                              |
+————————————+——–+———-+———————————————————————–+
| linode_wordpress_db.wp_login_fails | repair | error    | Can’t create new tempfile: ‘./linode_wordpress_db/wp_login_fails.TMD’ |
| linode_wordpress_db.wp_login_fails | repair | status   | Operation failed                                                      |
+————————————+——–+———-+———————————————————————–+
2 rows in set (0.00 sec)

然后去试试另外的:

➜  mysql cd /var/lib/
➜  lib pwd
/var/lib
➜  lib sudo -u mysql myisamchk -r -v -f mysql/linode_wordpress_db/wp_login_fails
– recovering (with sort) MyISAM-table ‘mysql/linode_wordpress_db/wp_login_fails’
Data records: 89285
– Fixing index 1
  – Searching for keys, allocating buffer for 95318 keys
Found block that points outside data file at 3903456
Wrong bytesec: 198- 92-  1 at    3903460; Skipped
Wrong bytesec:   1-  0-  0 at    3903468; Skipped
  – Dumping 89285 keys
➜  lib sudo -u mysql myisamchk -r -v -f mysql/linode_wordpress_db/wp_login_fails
– recovering (with sort) MyISAM-table ‘mysql/linode_wordpress_db/wp_login_fails’
Data records: 89285
– Fixing index 1
  – Searching for keys, allocating buffer for 95318 keys
  – Dumping 89285 keys
➜  lib sudo -u mysql myisamchk -r -v -f mysql/linode_wordpress_db/wp_login_fails
– recovering (with sort) MyISAM-table ‘mysql/linode_wordpress_db/wp_login_fails’
Data records: 89285
– Fixing index 1
  – Searching for keys, allocating buffer for 95318 keys
  – Dumping 89285 keys
➜  lib

【总结】

此处,由于mysql的数据库所在路径:

/var/lib/mysql/linode_wordpress_db

的权限,导致其他用户无法cd进入,所以无法使用:

myisamchk -r $TABLE_NAME

最后是通过:

➜  mysql cd /var/lib/
➜  lib sudo -u mysql myisamchk -r -v -f mysql/linode_wordpress_db/wp_login_fails
– recovering (with sort) MyISAM-table ‘mysql/linode_wordpress_db/wp_login_fails’
Data records: 89285
– Fixing index 1
  – Searching for keys, allocating buffer for 95318 keys
Found block that points outside data file at 3903456
Wrong bytesec: 198- 92-  1 at    3903460; Skipped
Wrong bytesec:   1-  0-  0 at    3903468; Skipped
  – Dumping 89285 keys

而解决了问题,修复了表。

转载请注明:在路上 » 【已解决】mysqldump导出数据库失败:Got error 144 Table wp_login_fails is marked as crashed

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
69 queries in 0.065 seconds, using 9.43MB memory