本文為其它文章的一部份
0x00 環境:
- Ubuntu 22.04 LTS
- WordPress 6
- MySQL 8
0x01 前言:
沒想到重置了密碼停用了外挂後wp還是報錯,表現為無法發布新文章,啟用停用wp外挂顯示成功但沒有效果。
查看了apache日志 /var/log/apache/fuwaaoi.com.error.log 發現很多類似的錯誤:
WordPress \xe8\xb3\x87\xe6\x96\x99\xe5\xba\xab\xe9\x8c\xaf\xe8\xaa\xa4: View 'information_schema.COLUMNS' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them (\xe7\x94\xb1 require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('wp_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, wfLog->actionSetRequestJSEnabled, wfLog::isHumanRequest \xe7\x9a\x84\xe6\x9f\xa5\xe8\xa9\xa2 SHOW FULL COLUMNS FROM `wp_wflivetraffichuman` \xe8\xa7\xb8\xe7\x99\xbc), referer: https://www.fuwaaoi.com/wp-cron.php?doing_wp_cron=1666107238.3668189048767089843750
把utf-8解碼得出:
WordPress 資料庫錯誤: View 'information_schema.COLUMNS' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them (由 require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('wp_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, wfLog->actionSetRequestJSEnabled, wfLog::isHumanRequest 的查詢 SHOW FULL COLUMNS FROM `wp_wflivetraffichuman` 觸發), referer: https://www.fuwaaoi.com/wp-cron.php?doing_wp_cron=1666107238.3668189048767089843750
好像是SHOW FULL COLUMNS FROM `wp_wflivetraffichuman`; 的時候報錯了
日志好像也被WP Chinese Conversion換成中文了(汗
0x02 嘗試解決問題:
1. 登入mysql選擇wordpress資料庫,嘗試列出資料庫下的表,錯誤
use wordpress;
show tables;
ERROR 1449 (HY000): The user specified as a definer ('mysql.infoschema'@'localhost') does not exist
2. 移除 mysql.infoschema 並重新新增
DROP USER 'mysql.infoschema'@'localhost';
CREATE USER 'mysql.infoschema'@'localhost' IDENTIFIED BY '<password>';
GRANT SELECT ON *.* TO `mysql.infoschema`@`localhost`;
3. show tables; 成功執行,wp也算是暫時恢復了。
Comments | NOTHING