登陆

作为DBA不得不把握的一个mysql兼容参数--show_compatibility_56

admin 2019-10-29 216人围观 ,发现0个评论

概述

之前在布置时有一个报错便是由于show_compatibility_56参数引起的,不过没有对这个参数要点介绍,所以下面依据官网内容独自介绍一下。

官网介绍:

show_compatibility_56 is deprecated作为DBA不得不把握的一个mysql兼容参数--show_compatibility_56 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后,假如已经在之前的版别中运用此插件对InnoD作为DBA不得不把握的一个mysql兼容参数--show_compatibility_56B表空间进行了加密,在敞开作为DBA不得不把握的一个mysql兼容参数--show_compatibility_56服务时需求指定参数 --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%';


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作为DBA不得不把握的一个mysql兼容参数--show_compatibility_56 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_sc作为DBA不得不把握的一个mysql兼容参数--show_compatibility_56hema表)发生的输出与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.stat作为DBA不得不把握的一个mysql兼容参数--show_compatibility_56us_by_thread
performance_schema.status_by_account
performance_schema.status_by_host
performance_schema.status_by_user



篇幅有限,这块内容就介绍到这了。后边会共享更多devops和DBA方面的内容辐射,感兴趣的朋友能够重视下~

请关注微信公众号
微信二维码
不容错过
Powered By Z-BlogPHP