gpt4 book ai didi

php - MySql 更新后找不到 mysql.infoschema

转载 作者:可可西里 更新时间:2023-11-01 06:31:36 25 4
gpt4 key购买 nike

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

在此之后我无法看到我的任何数据库或在 phpMyAdmin 上运行任何命令。我尝试执行的所有操作都会导致涉及 mysql.infoschema 表的错误。

我得到的大多数错误是这样的:#1449 - 指定为定义者的用户 ('mysql.infoschema'@'localhost') 不存在

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

在搜索涉及版本 5.7 和 8.0.11 的重大问题后,我在这个 site 中看到了系统表已移至 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 错误。

附言。我正在使用 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.

关于php - MySql 更新后找不到 mysql.infoschema,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51155026/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com