0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[MySQL] "the user specified as a definer ('mysql.infoschema'@'localhost') does not exist" エラー解決法

Posted at

概要

MySQL 5.7 のサービスを
今回 MySQL 8.0.xに移行したが
wordpressを動かしてみると、一応connectはできるものの いろいろエラーが出る..

[07-Oct-2023 05:23:46 UTC] WordPress database error View 'information_schema.COLUMNS' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them for query SHOW FULL COLUMNS FROM `wp_options` made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/biz-vektor-master/index.php'), get_sidebar, locate_template, load_template, require_once('/themes/biz-vektor-master/sidebar-page.php'), dynamic_sidebar, WP_Widget->display_callback, Top_Ten_Widget->widget, tptn_pop_posts, set_transient, wp_cache_set, W3TC\ObjectCache_WpObjectCache->set, W3TC\ObjectCache_WpObjectCache_Regular->set, W3TC\ObjectCache_WpObjectCache_Regular->_transient_fallback_set, update_option, W3TC\DbCache_WpdbNew->update, W3TC\DbCache_WpdbInjection_QueryCaching->update, W3TC\_CallUnderlying->update, W3TC\DbCache_WpdbNew->update, W3TC\DbCache_WpdbInjection->update, W3TC\DbCache_WpdbNew->default_update, W3TC\DbCache_WpdbNew->query, W3TC\DbCache_WpdbInjection->query, W3TC\DbCache_WpdbNew->default_query

原因

MySQL upgrade の対応をしなくてはならない..
https://dev.mysql.com/doc/refman/8.0/ja/upgrading-what-is-upgraded.html

解決法

$ sudo systemctl stop mysql # 停止..
$ sudo mysqld --upgrade=FORCE & # 起動コマンド upgradeを実行してくれるよう -> そのままプロセスが立ち上がるため、以下のログで connection readyとなっていれば killして service restart
tail -f /var/log/mysqld.log # or /var/log/mysql.mysqld.log

$ sudo systemctl restart mysql # 再起動

--upgrade=FORCE では、サーバーは必要に応じてデータディクショナリ、パフォーマンススキーマおよび INFORMATION_SCHEMA をアップグレードし (ステップ 1)、他のすべてのものを強制的にアップグレードします (ステップ 2)。 サーバーはすべてのスキーマ内のすべてのオブジェクトをチェックするため、このオプションではサーバーの起動に時間がかかります。
FORCE は、必要ないとサーバーが判断した場合に、ステップ 2 のアクションを強制的に実行する場合に役立ちます。 FORCE と AUTO の違いの 1 つは、FORCE では、ヘルプテーブルやタイムゾーンテーブルが欠落している場合は、サーバーによってシステムテーブル (ヘルプテーブルやタイムゾーンテーブルなど) が再作成されることです。

->
これでエラーは出なくなった

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?