本地表'performance_schema'.'???' 有错误的结构

P H*_*ans 64 mysql

我得到以下内容:

Native table 'performance_schema'.'file_instances' has the wrong structure
Native table 'performance_schema'.'cond_instances' has the wrong structure
Native table 'performance_schema'.'rwlock_instances' has the wrong structure
Native table 'performance_schema'.'mutex_instances' has the wrong structure
...
Run Code Online (Sandbox Code Playgroud)

并且当它重新启动MySql时出现这些错误.它似乎导致MySql管理员变得不稳定,我得到了很多:

"MySQL server has gone away"
Run Code Online (Sandbox Code Playgroud)

Mus*_*usa 219

在shell中尝试以下命令(root用户在这里是mysql root用户,而不是系统root)

sudo mysql_upgrade -u root -p
Run Code Online (Sandbox Code Playgroud)

确保在运行此命令后重新启动mysql(在评论中全部归功于@Mikepote.)

  • 如果有任何人在运行mysql_upgrade之后仍然有此错误*尝试重新启动mysql服务.这为我修好了. (82认同)
  • 谢谢Mikepote,这正是我遇到的问题.我运行mysql_upgrade,然后得到了这个错误,并在阅读你的评论后意识到我没有重新启动mysql. (2认同)
  • 虽然我不得不使用`--force`开关,因为在我的情况下它没有mysql错误,也为我工作了两个基于debian的机器. (2认同)

Ale*_*ets 22

我的情况是在桌面上运行特定查询时出现的情况.

并且日志还包含:

缺少系统表mysql.proxies_priv; 请运行mysql_upgrade来创建它

我运行了mysql_upgrade,然后问题就消失了.

  • 如上所述,您必须在运行mysql_upgrade后重新启动服务器.在此之前,您将继续看到这些错误. (3认同)

mka*_*man 17

我遇到了这个问题,答案是@Berend de Boer

升级后重启mysql.

[错误]本机表性能架构具有错误的结构


wen*_*ens 6

当您在以前的安装中安装了MySQL时,会遇到此错误,该安装是在没有性能架构或性能架构的较旧版本(可能没有所有当前表)的情况下配置的。

我在上也遇到了这个问题。为了解决这个问题,我执行了以下操作:

cd /Applications/MAMP/bin/
sudo ./upgradeMysql.sh 
Run Code Online (Sandbox Code Playgroud)

记住要重启mysql服务器。

您可以阅读性能架构构建配置以获取更多详细信息。


Ahm*_*gle -3

显然 MySQL 模式存储由于某种原因而损坏。这些原因可能是:

  • 你破坏了数据库information_schema
  • 文件系统损坏或文件系统中的某些错误损坏了数据库。
  • MySQL 内部由于 MySQL 中的一个错误而破坏了模式数据库(也许以前没有人遇到过)。

如果您没有备份但仍然可以访问数据,请先备份数据,然后执行以下操作:

如果你有备份,那么重新安装MySQL(之前彻底清除mysql的所有数据),然后导入你的数据。

  • 这个答案需要删除。 (19认同)
  • 首先检查这个答案,而不是重新安装:http://stackoverflow.com/a/20262826/2166188。@Musa的回答对我有用。 (8认同)