MySql 更新后找不到 mysql.infoschema

MySql Can't find mysql.infoschema after update

今天早上,我的 mySQL 在我的系统上自动从版本 5.7 更新到 8.0.11。

在此之后我看不到我的任何数据库或运行 phpMyAdmin 上的任何命令。我尝试做的所有事情都会导致涉及 mysql.infoschema table.

的错误

我得到的大部分错误是这样的:#1449 - The user specified as a definer ('mysql.infoschema'@'localhost') does not exist

我已经搜索了错误并尝试 运行ning 命令来创建用户 GRANT ALL ON *.* TO 'someuser'@'%' IDENTIFIED BY 'complex-password'; FLUSH PRIVILEGES;,如 this 答案中所示。但我不断收到语法错误。

在搜索涉及版本 5.7 和 8.0.11 的重大问题后,我在此 site 中看到系统 table 已移至 InnoDB。

The first storage engine for MySQL - MyISAM and was available in MySQL up to now. MySQL 5.7 still uses MyISAM for the MySQL privilege tables in the MySQL schema but in MySQL they are moved to InnoDB.

我什至尝试全新安装 8.0.11 版,这样我就可以导入我的数据库,但是当我尝试以 root 身份登录时,我遇到了同样的 #1449 错误。

Ps。我正在使用 Fedora 28。

You should execute mysql_upgrade each time you upgrade MySQL.

这是因为在某些升级或降级之后,表会发生变化,您需要(重新)创建一些权限

mysql -u root -p
mysql> SET GLOBAL innodb_fast_shutdown = 1;
mysql_upgrade -u root -p

mysql_upgrade examines all tables in all databases for incompatibilities with the current version of MySQL Server. mysql_upgrade also upgrades the system tables so that you can take advantage of new privileges or capabilities that might have been added.