提示:The 'INFORMATION_SCHEMA.SESSION_VARIABLES' feature is disabled; see the documentation for 'show_compatibility_56'
以下转自:http://blog.youkuaiyun.com/rudygao/article/details/50403107
--从mysql5.7.6开始information_schema.global_status已经开始被舍弃,为了兼容性,此时需要打开 show_compatibility_56
mysql> select * from information_schema.global_status limit 3;
ERROR 3167 (HY000): The 'INFORMATION_SCHEMA.GLOBAL_STATUS' feature is disabled; see the documentation for 'show_compatibility_56'
--查看show_compatibility_56其值
mysql> show variables like '%show_compatibility_56%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| show_compatibility_56 | OFF |
+-----------------------+-------+
1 row in set (0.01 sec)
--把show_compatibility_56打开
mysql> set global show_compatibility_56=on;
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like '%show_compatibility_56%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| show_compatibility_56 | ON |
+-----------------------+-------+
1 row in set (0.00 sec)
mysql> select * from information_schema.global_status limit 3;
+-----------------------+----------------+
| VARIABLE_NAME | VARIABLE_VALUE |
+-----------------------+----------------+
| ABORTED_CLIENTS | 0 |
| ABORTED_CONNECTS | 0 |
| BINLOG_CACHE_DISK_USE | 0 |
+-----------------------+----------------+
3 rows in set, 1 warning (0.00 sec)
本文详细介绍了如何在MySQL 5.7.6版本中解决INFORMATION_SCHEMA.SESSION_VARIABLES功能被禁用的问题。通过开启show_compatibility_56特性,可以恢复对全局状态表的操作,从而获取MySQL服务器的运行状态信息。文章包括操作步骤、关键命令解释以及实例演示,帮助读者快速定位和解决问题。
253

被折叠的 条评论
为什么被折叠?



