skip to Main Content

wordpress修复数据表

今天打算重启某子站,安装wordpress并填入数据库、用户名及密码,显示:
One or more database tables are unavailable. The database may need to be repaired.

repaired是个链接,点击显示:
To allow use of this page to automatically repair database problems, please add the following line to your wp-config.php file. Once this line is added to your config, reload this page.

define(‘WP_ALLOW_REPAIR’, true);

提示在wp-config.php插入define(‘WP_ALLOW_REPAIR’, true); 可惜只有wp-config-sample.php,再次安装,发现有了wp-config.php。

刷新,提示:
One or more database tables are unavailable. To allow WordPress to attempt to repair these tables, press the “Repair Database” button. Repairing can take a while, so please be patient.

Repair Database

WordPress can also attempt to optimize the database. This improves performance in some situations. Repairing and optimizing the database can take a long time and the database will be locked while optimizing.

Repair and Optimize Database
点击修复并优化数据库,结果是:
wp_users: Table ‘jrubbish_yellow.wp_users’ doesn’t exist
wp_usermeta: Table ‘jrubbish_yellow.wp_usermeta’ doesn’t exist
wp_posts: Table ‘jrubbish_yellow.wp_posts’ doesn’t exist
wp_comments: Table ‘jrubbish_yellow.wp_comments’ doesn’t exist
wp_links: Table ‘jrubbish_yellow.wp_links’ doesn’t exist
wp_options: Table ‘jrubbish_yellow.wp_options’ doesn’t exist
wp_postmeta: Table ‘jrubbish_yellow.wp_postmeta’ doesn’t exist
wp_terms: Table ‘jrubbish_yellow.wp_terms’ doesn’t exist
wp_term_taxonomy: Table ‘jrubbish_yellow.wp_term_taxonomy’ doesn’t exist
wp_term_relationships: Table ‘jrubbish_yellow.wp_term_relationships’ doesn’t exist

一开始我就觉得这个子站几千篇文章数据库不可能才10M,打开检查确实缺少这些数据表。
妈的,想起来了,几年前做的这个子站,下载之后从cPanel里删除了数据库,然后又上传,估计当时没有上传完整。
以前过于二逼,搞了一百多网站。现在兴趣爱好放一边,不挣钱的事情不做了。