1.首先查看是否开启profiling功能 SHOW VARIABLES LIKE '%pro%'; 或者 SELECT @@profiling; 2.开启profiling ; 3.执行sql语句例如: SELECT table_schema FROM cqh_test GROUP BY table_schema ; 4.查看结果 SHOW profiles; 查看查询语句的信息(QUERY_ID,查询时间,查询语句内容)SHOW profile FOR QUERY 8 查看QUERY_ID为…
Mysql 常用 SQL 语句集锦 基础篇 //查询时间,友好提示 $sql = "select date_format(create_time, '%Y-%m-%d') as day from table_name"; //int 时间戳类型 $sql = "select from_unixtime(create_time, '%Y-%m-%d') as day from table_name"; //一个sql返回多个总数 $sql = "select…
Mysql 常用 SQL 语句集锦 基础篇 //查询时间,友好提示 $sql = "select date_format(create_time, '%Y-%m-%d') as day from table_name"; //int 时间戳类型 $sql = "select from_unixtime(create_time, '%Y-%m-%d') as day from table_name"; //一个sql返回多个总数 $sql = "select…