-- 查看是否開啟
show variables like "%profiling%";
-- 查看是否支持 show profile yes表示支持 no表示不支持
select @@have_profiling;
-- 查看是否開啟 1:開啟了 0:未開啟 默認(rèn)為0
select @@profiling
-- 開啟命令
set profiling = 1
-- 查看最近15條的查詢記錄
show profiles
-- 根據(jù)query ID 查詢分析
show profile cpu,block io for query 87;
-- 關(guān)閉profile
set profiling=off;
聯(lián)系客服