Mysql 本机表';性能模式''';有错误的结构

Mysql 本机表';性能模式''';有错误的结构,mysql,mamp,Mysql,Mamp,我得到以下信息: 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 '

我得到以下信息:

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
...
cd /Applications/MAMP/bin/
sudo ./upgradeMysql.sh 
然后就开始了 这些错误在我重新启动MySql时出现。这似乎导致MySql管理员变得不稳定,我得到了很多:

"MySQL server has gone away"

显然,MySQL模式存储被破坏是有原因的。这些原因可能是:

  • 您已破坏数据库
    信息\u架构
  • 文件系统损坏或文件系统中的某些错误损坏了数据库
  • 由于MySQL中的错误,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
...
cd /Applications/MAMP/bin/
sudo ./upgradeMysql.sh 

如果您有备份,那么重新安装MySQL(在此之前完全清除MySQL的所有数据),然后导入您的数据。

Im我的案例在表上运行特定查询时出现

日志还包括:

缺少系统表mysql.proxies_priv;请运行mysql\u升级到 创造它


我已经运行了mysql\u升级,在问题解决之后。

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


运行此操作后,请确保重新启动mysql(注释中的所有内容都归功于@Mikepote)。

如果数据库是Akonadi(KDE)数据库,上述内容将不够。 您需要镜像提供给mysqld的选项,请与

ps aux | grep mysql
将选项复制到mysql_upgrade命令(我不需要“-u root-p”,但您可能需要)


我真的认为--socket选项是关键。

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

升级后重新启动mysql


当您在以前的安装上安装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
...
cd /Applications/MAMP/bin/
sudo ./upgradeMysql.sh 
记住重新启动mysql服务器


您可以阅读以了解更多详细信息。

尝试
mysql\u升级
,然后重新启动mysql及其恢复工作

似乎这是在您完成升级后发生的。只需重新启动mysql:

类似于CMD中的run-down命令

sudo mysql_upgrade -u root -p

service mysql restart

错误现在应该消失了。

innodb多次尝试重新安装,但都没有成功。最后,我不得不作为一个非事务性数据库重新安装(我相信是禁用了innodb),这就解决了这个问题。感谢不要重新安装,请先检查以下答案:@Musa的答案对我很有用。这个答案需要删除。正确的解决方案是@Musa在他的帖子中更新的内容……对于较小的数据量来说,这可能没问题,但如果db大小超过500 GB,又会怎么样。这个答案是一个极端的路径,而Musa的答案对许多人(包括我)来说都是有效的,而且应用起来更快、更容易,应在继续数据库替换之前尝试。是的,升级到新版本而不升级mysql\u可能会导致错误的结构错误。如果任何人在运行mysql\u升级后仍存在此错误,请尝试重新启动mysql服务。这帮我解决了。谢谢,米凯波特,这正是我遇到的问题。我运行了mysql_升级,然后出现了这个错误,在读了你的评论后意识到我没有重新启动mysql。我在Ubuntu 15.04上升级到5.7.10,需要重新启动机器,错误才能从mysql Workbench中消失。我在两台基于debian的机器上工作,虽然我不得不使用
--force
开关,因为在我的情况下,这不是mysql的错误。如上所述,在运行mysql\u升级后,您必须重新启动服务器。在此之前,您将继续看到这些错误。它是什么?从没听说过@@只有在同一台机器上运行多个mysql服务时才需要它。