详解MySQL兼容性show_compatibility_56参数

概述

简单记录一下以下报错的解决办法, 仅供参考。

在涉及到MySQL5.6mysql5.7数据库时提示以下报错:

DBD::mysql::st execute failed: The 'INFORMATION_SCHEMA.GLOBAL_VARIABLES' feature is disabled; see the documentation for 'show_compatibility_56' at myawr.pl line 760.

 


解决过程

mysql5.7.6开始information_schema.global_status已经开始被舍弃,为了兼容性,此时需要打开show_compatibility_56

1、查看show_compatibility_56

MySQL> show variables like '%show_compatibility_56%';

 

2、把show_compatibility_56打开

mysql> set global show_compatibility_56=on;

mysql> show variables like '%show_compatibility_56%';

 


show_compatibility_56参数

MySQL5.6版本到5.7版本的更新包括一些不兼容的特性,在升级到5.7之前,我们需要知道这些不兼容的特性并手动更新,在其中涉及到REPAIR TABLEUSE_FRM选项的指令一定要在更新版本之前完成。

配置项更新:

1--early-plugin-load

MySQL5.7.11,此参数的默认值为keyring_file(是一个二进制文件的插件),InnoDB表空间在初始化InnoDB之前需要此插件来加密,但是MySQL5.7.12及以后此参数默认为空,所以5.7.11升级到5.7.12后,如果已经在之前的版本中使用此插件对InnoDB表空间进行了加密,在开启服务时需要指定参数 --early-plugin-load

2、系统表

MySQL5.6INFORMATION_SCHEMA 中存在系统变量和状态变量的表,show variables show status也是基于此库中的表,在5.7.6时被Performance Schema也存在这四张表,show 语句开始基于Performance Schema中的表,如果show_compatibility_56参数开启,则兼容5.6

 

发布了481 篇原创文章 · 获赞 72 · 访问量 41万+

猜你喜欢

转载自blog.csdn.net/w892824196/article/details/104087210