#1.基本的高级操作
#当前存储引擎
show engine;
#所有的存储引擎
show ENGINES;
#查看当前库中所有表的存储引擎以及详细信息
show table status from database;
#MySQL最大连接数
show VARIABLES like ‘%max_connections%’;
#最大线程数
show VARIABLES like ‘%thread_cache%’;
#mysql 自带缓存模块,默认off,需要手动开启,特性类似mybatis二级缓存(一条数据更新,所有缓存失效),mysql8.0已经干掉该模块
show variables like ‘%query_cache%’;
#最大超时时间–非交互式 如jdbc
show global variables like ‘wait_timeout’;
#最大超时时间—交互式—如navicat
show global VARIABLES like ‘interactive_timeout’;
#语法分析
#查询同一sql的不同执行方式的开销 —
show status like ‘Last_query_cost’;
#optimizer_trace(优化器)的作用,在多表关联查询时,可以通过调整索引或主表等因素,来看执行计划的开销(即执行时间)
explain 查看执行计划,进行索引优化等