记录一下日志中数据库的错误及解决 | 祭夜博客
  • 欢迎光临,这个博客颜色有点多

记录一下日志中数据库的错误及解决

Wordpress msojocs 7年前 (2017-08-09) 3561次浏览 已收录 0个评论 扫描二维码

刚刚去管理网站文件的时候,看到根目录有个error_log日志文件,

于是就打开了,惨不忍睹。。。

记录一下日志中数据库的错误及解决

错误都相似。。。全是数据库

解决&处理

以下为个人理解,估计错了不少,毕竟没学数据库,也没做一些基本了解。。。

1.查看&分析

WordPress数据库查询SELECT term_id, meta_key, meta_value FROM wp_termmeta WHERE term_id IN (43,125,122,53,116,117,118,67) ORDER BY meta_id ASC时发生Unknown column 'term_id' in 'field list'错误,这是由require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/Git/category.php'), get_header, locate_template, load_template, require_once('/themes/Git/header.php'), wp_nav_menu, wp_get_nav_menu_items, get_terms, WP_Term_Query->query, WP_Term_Query->get_terms, update_termmeta_cache, update_meta_cache查询的
。

应该是说“在数据表 wp_termmeta 中没有找到字段 term_id ”,既然没找到那我们就添加呗
简单的就添加字段即可,
复杂的执行sql:

ALTER TABLE  `wp_termmeta` ADD COLUMN term_id char(32) NOT NULL DEFAULT '';

类似
查询SELECT term_id, meta_key, meta_value FROM xxx WHERE term_id IN (43,125,122,53,116,117,118,67) ORDER BY meta_id ASC时发生Unknown column ‘aaa‘ in ‘field list’错误
就用执行

ALTER TABLE  `xxx` ADD COLUMN aaa char(32) NOT NULL DEFAULT '';

来解决
2. xxx.aaa dosen’t exist 表示xxx数据库中不存在aaa数据表 直接在xxx数据表下新建aaa数据表即可

3.

WordPress数据库查询SELECT term_id, meta_key, meta_value FROM wp_termmeta WHERE term_id IN (43,125,122,53,116,117,118,67) ORDER BY meta_id ASC时发生Unknown column 'meta_id' in 'order clause'错误,这是由require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/Git/category.php'), get_header, locate_template, load_template, require_once('/themes/Git/header.php'), wp_nav_menu, wp_get_nav_menu_items, get_terms, WP_Term_Query->query, WP_Term_Query->get_terms, update_termmeta_cache, update_meta_cache查询的。

和第一个差不多也是缺少字段,添加即可


祭夜の咖啡馆 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:记录一下日志中数据库的错误及解决
喜欢 (0)
[1690127128@qq.com]
分享 (0)

您必须 登录 才能发表评论!