mysql5.6版本 百度百科_作为DBA不得不掌握的一个mysql兼容参数-show_compatibility_56-建站-站长头条...

概述

之前在部署时有一个报错就是因为show_compatibility_56参数引起的,不过没有对这个参数重点介绍,所以下面根据官网内容单独介绍一下。

官网介绍:

3549885513bbfa00cb474552b9734881.pngshow_compatibility_56 is deprecated because its only purpose is to permit control over deprecated system and status variable information sources that will be removed in a future MySQL release. When those sources are removed, show_compatibility_56 will have no purpose and will be removed as well.

show_compatibility_56参数

MySQL5.6版本到5.7版本的更新包括一些不兼容的特性,在升级到5.7之前,我们需要知道这些不兼容的特性并手动更新,在其中涉及到REPAIR TABLE和USE_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.6中INFORMATION_SCHEMA 中存在系统变量和状态变量的表,show variables 和show status也是基于此库中的表,在5.7.6时被Performance Schema也存在这四张表,show 语句开始基于Performance Schema中的表,如果show_compatibility_56参数开启,则兼容5.6

开启show_compatibility_56

1、查看show_compatibility_56值MySQL> show variables like '%show_compatibility_56%';

cc848facfbf02500d458929192535a3b.png

2、把show_compatibility_56打开mysql> set global show_compatibility_56=on;

3、永久打开

在my.cnf增加一行参数show_compatibility_56 = 1

show_compatibility_56影响

影响以下方面:

Information available from the SHOW VARIABLES and SHOW STATUS statements

Information available from the INFORMATION_SCHEMA tables that provide system and status variable information

Information available from the Performance Schema tables that provide system and status variable information

The effect of the FLUSH STATUS statement on status variables

如果打开show_compatibility_56时,将启用与MySQL 5.6的兼容性。旧的变量信息源(show语句、information_schema表)产生的输出与mysql 5.6中相同。

当show_compatibility_56打开时,可以从show Status获得几个Slave_xxx状态变量。当show_compatibility_56关闭时,这些变量中的一些不会公开显示状态。它们提供的信息在与复制相关的性能架构表中可用,如后文所述。

关闭show_compatibility_56时,将禁用与mysql 5.6的兼容性。从信息架构表中进行选择会产生错误,因为性能架构表要替换它们。从mysql 5.7.6开始,information_schema表就被弃用,并将在以后的mysql版本中删除。

--把show_compatibility_56关闭

mysql> set global show_compatibility_56=off;

mysql> select * from information_schema.global_status limit 3;

--把show_compatibility_56打开

mysql> set global show_compatibility_56=on;

mysql> show variables like '%show_compatibility_56%';

mysql> select * from information_schema.global_status limit 3;

--In MySQL 5.6, system and status variable information is available from these SHOW statements:

SHOW VARIABLES

SHOW STATUS

And from these INFORMATION_SCHEMA tables:

INFORMATION_SCHEMA.GLOBAL_VARIABLES

INFORMATION_SCHEMA.SESSION_VARIABLES

INFORMATION_SCHEMA.GLOBAL_STATUS

INFORMATION_SCHEMA.SESSION_STATUS

--MySQL 5.7

--As of MySQL 5.7.6, the Performance Schema includes these tables as new sources of system and status variable information:

performance_schema.global_variables

performance_schema.session_variables

performance_schema.variables_by_thread

performance_schema.global_status

performance_schema.session_status

performance_schema.status_by_thread

performance_schema.status_by_account

performance_schema.status_by_host

performance_schema.status_by_user

7f87b16efb0086fc0371bf428a4ddc19.png

a5800e975064ab0b1cb67d03dd02ae10.png

篇幅有限,这块内容就介绍到这了。后面会分享更多devops和DBA方面的内容,感兴趣的朋友可以关注下~

0d219546161669b2ce55e6d85a8a3037.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值