除了通过前面演示的使用show global|session variables like 'vari_name'方式之外,我们可以通过查询
information_schema数据中特定的表来获得这些变量的值。
通过查询数据information_schema的表global_variables
root@localhost[information_schema]> select variable_value from global_variables where
-> variable_name='tx_isolation';
+----------------+
| variable_value |
+----------------+
| SERIALIZABLE |
+----------------+
--Author: Leshami
--Blog : http://blog.csdn.net/leshami
root@localhost[information_schema]> select @@global.tx_isolation;
+-----------------------+
| @@global.tx_isolation |
+-----------------------+
| SERIALIZABLE |
+-----------------------+
root@localhost[information_schema]> select @@session.tx_isolation;
+------------------------+
| @@session.tx_isolation |
+------------------------+
| READ-COMMITTED |
+------------------------+
--下面查询session_variables结果与查询global_variables获得的值相同,究其原因还在进一步研究中
root@localhost[information_schema]> select * from session_variables where variable_name='tx_isolation';
+---------------+----------------+
| VARIABLE_NAME | VARIABLE_VALUE |
+---------------+----------------+
| TX_ISOLATION | SERIALIZABLE |
+---------------+----------------+
5、总结
b、检索设置
c、其他注意事项