mysql的 profiling不是默认打开的

查看profiling是否找开

mysql> show variables like "%pro%";
+---------------------------+-------+
| Variable_name | Value |
+---------------------------+-------+
| profiling | OFF |
| profiling_history_size | 15 |
| protocol_version | 10 |
| slave_compressed_protocol | OFF |
+---------------------------+-------+

打开profiling

mysql> set profiling=1;

使用

mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| test    |
| user           |
+----------------+
mysql> select * from test;
mysql> show profiles;
+----------+------------+------------------------+
| Query_ID | Duration   | Query                  |
+----------+------------+------------------------+
|        1 | 0.00054675 | show tables            |
|        2 | 0.00032400 | select * from test       |
+----------+------------+------------------------+
2 rows in set (0.00 sec)
mysql> show profile for query 1;
+----------------------+-----------+
| Status               | Duration  |
+----------------------+-----------+
| (initialization)     | 0.000028  |
| checking permissions | 0.000007  |
| Opening tables       | 0.0000939 |
| System lock          | 0.0000017 |
| Table lock           | 0.0000055 |
| init                 | 0.000009  |
| optimizing           | 0.0000027 |
| statistics           | 0.0000085 |
| preparing            | 0.0000065 |
| executing            | 0.000004  |
| checking permissions | 0.000258  |
| Sending data         | 0.000049  |
| end                  | 0.0000037 |
| query end            | 0.0000027 |
| freeing items        | 0.0000307 |
| closing tables       | 0.0000032 |
| removing tmp table   | 0.0000275 |
| closing tables       | 0.0000037 |
| logging slow query   | 0.000002  |
+----------------------+-----------+
19 rows in set (0.00 sec)

查看mysql执行时间的更多相关文章

  1. [mysql] 查看mysql执行时间

    mysql的 profiling不是默认打开的 查看profiling是否找开 mysql> show variables like "%pro%"; +---------- ...

  2. 查看mysql中sql语句执行时间

    查看mysql版本:select version();方法一: show profiles.1. Show profiles是5.0.37之后添加的,要想使用此功能,要确保版本在5.0.37之后.  ...

  3. 查看mysql正在执行的SQL语句,使用profile分析SQL执行状态

    http://qq85609655.iteye.com/blog/2113960 1)我们先通过status命令查看Mysql运行状态 mysql> status; -------------- ...

  4. 查看mysql数据库版本方法总结

    当你接手某个mysql数据库管理时,首先你需要查看维护的mysql数据库版本:当开发人员问你mysql数据库版本时,而恰好你又遗忘了,那么此时也需要去查看mysql数据库的版本............ ...

  5. 关于如何查看MySQL版本:

    方法一: 进入mysql cmd, status; 将显示当前mysql的version的各种信息. 方法二: 还是在mysql的cmd下,输入: select version(); 查看MySQL端 ...

  6. 查看mysql,apache,php,nginx编译参数

    查看nginx编译参数: #/usr/local/nginx/sbin/nginx -V   查看mysql编译参数: cat /usr/local/mysql/bin/mysqlbug | grep ...

  7. 查看Mysql实时执行的Sql语句

    最近给客户开发了基于Asp.Net mvc5 +Mysql+EF的项目,但是在EF里无法看到Mysql执行的语句 之前也找到一些监控Mysql的软件但一直没有用起来,现在又遇到了问题即在EF里Mysa ...

  8. 查看mysql表结构和表创建语句的方法(转)

    查看mysql表结构的方法有三种:1.desc tablename;例如:要查看jos_modules表结构的命令:desc jos_modules;查看结果:mysql> desc jos_m ...

  9. 查看mysql语句运行时间

    show profiles 之类的语句来查看 mysql> show profiles; Empty set mysql> show variables like "%pro%& ...

随机推荐

  1. 一秒可生成500万ID的分布式自增ID算法—雪花算法 (Snowflake,Delphi 版)

    概述 分布式系统中,有一些需要使用全局唯一ID的场景,这种时候为了防止ID冲突可以使用36位的UUID,但是UUID有一些缺点,首先他相对比较长,另外UUID一般是无序的. 有些时候我们希望能使用一种 ...

  2. tkinter中Partial Function Example

    from functools import partial as pto from tkinter import Tk, Button, X from tkinter.messagebox impor ...

  3. 实现一个 web 服务器

    在 system1 上配置一个站点 http://system1.group8.example.com/,然后执行下述步骤: 1.从 http://server.group8.example.com/ ...

  4. Nas 系统的虚拟化方案

    Nas 系统的虚拟化方案 https://zhuanlan.zhihu.com/p/55025102 对搞技术的人来说,Nas 是个理想的玩具,既然是程序员用的 Nas ,自然要专业一点,不能像小白一 ...

  5. Fiddler-修改请求的上行参数

    方法一:对所有的请求打断点 1.rules->automatic Breakpoints->Befor Requests 2.点击选择需要修改的请求 3.选择右侧请求区域的 Inspect ...

  6. Oracle 用户与模式的关系

    一.用户登录 Oracle 数据库的安全保护流程分为3个步骤. 1.用户向数据库提供身份识别信息,即提供一个数据库账号 2.证明身份识别信息是否有效,通过密码来实现 3.用户输入的密码经过数据库的核对 ...

  7. k8s资源清单基础

    资源清单介绍 创建资源的方法  apiserver仅接收JSON格式的资源定义  yaml格式提供配置清单 apiserver可自动把yaml转换成json格式数据 资源清单五个一级字段   1.ap ...

  8. Python实现柱状图【数字精准展示,使用不同颜色】

    一.简介 主要使用matplotlib基于python的可视化组件实现. 二.代码实现 # -*- coding: utf-8 -*- """ Created on Mo ...

  9. java requestmapping中关于路径的问题

    需要这种url写的方式才能映射

  10. 05-jQuery介绍

    本篇主要介绍jQuery的加载.jquery选择器.jquery的样式操作.jQuery的事件.jquery动画等相关知识. 一.jQuery介绍 jQuery是目前使用最广泛的javascript函 ...