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

标签 php mysql phpmyadmin fedora

今天早上,我的 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/

相关文章:

java - 如何解决java.sql.SQLException : in integration of database with JDBC API?

phpmyadmin - The selected user was not found in the privilege table 在PhpMyAdmin中创建用户时出现错误

mysql - 如果找到变量如何停止执行查询

使用 mysql 控制台时出现 mysql 错误

php - 使用文本框从 MySQL 数据库中优化 PDO 结果

php - 使用 CASE 更新多行需要很长时间

php - Eloquent WHERE IN 使用原始查询/胶囊管理器

php - 使用 PHP/ffmpeg 将上传的音频文件转换为 mp3

mysql - SQL - 更新多个表,其中内部联接值来自第三个表

php - Netbeans 抛出语法错误 - php