mysql show global variables字符超1024会被截断

 show variables 会存在数据被截断的问题:

 

 select 全局变量没有问题

 

官网解释:https://dev.mysql.com/doc/refman/5.6/en/variables-table.html

The VARIABLE_VALUE column for each of these tables is defined as VARCHAR(1024). For variables with very long values that are not completely displayed, use select as a workaround. 

所以如果要写一些检测脚本,尽量用select 变量来查询,避免发生误判。

原文地址:https://www.cnblogs.com/zejin2008/p/7809810.html