首先登入MySQL。

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2294
Server version: 5.5.52-MariaDB MariaDB Server Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [xxx]>

  

先查看一下二进制的记录日志是否打开。

MariaDB [xxx]> show variables where Variable_name="general_log";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| general_log | ON |
+---------------+-------+
1 row in set (0.01 sec)

  

我这里看起来是打开的,如果是OFF。则需要打开这个选项:

set global general_log=on;

  

然后确认一下默认的log产生在哪里:

MariaDB [xxx]> show variables where Variable_name="general_log_file";
+------------------+-----------------+
| Variable_name | Value |
+------------------+-----------------+
| general_log_file | 10-0-236-38.log|
+------------------+-----------------+
1 row in set (0.00 sec)

  

然后搜索一下它,得到日志路径:

[root@10-0-236-38 ~]# find / -name "10-0-236-38.log"
/var/lib/mysql/10-0-236-38.log

  

大功告成。

[root@10-0-236-38 ~]# vim /var/lib/mysql/10-0-236-38.log

查看MySQL最近执行的语句的更多相关文章

  1. mysql 查看当前正在执行的语句

    查看当前正在执行的语句 show processlist:show processlist; 结束正在执行的语句进程 kill 进程id

  2. MySQL中执行sql语句错误 Error Code: 1093. You can't specify target table 'car' for update in FROM clause

    MySQL中执行sql语句错误 Error Code: 1093. You can't specify target table 'car' for update in FROM clause 201 ...

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

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

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

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

  5. Entity Framework 在MySQL中执行SQL语句,关于参数问题

    在Entity Framework中添加MySQL模型,在写代码的过程中需要直接执行SQL语句. 在SQL语句中用到了@curRank := 0 这样在SQL语句中定义参数,同时还会有传入参数:ai. ...

  6. JDBC连接MYSQL,批量执行SQL语句或在执行一个SQL语句之前执行一个SQL语句

    conn = MysqlJdbcUtils.getConnection(); Statement ps=conn.createStatement(); ps.addBatch("trunca ...

  7. (转载)MySQL中执行sql语句反斜杠需要进行转义否则会被吃掉

    (转载)http://www.phpcode8.com/lamp/mysql-lamp/mysql-escape-slash.html 最近在执行一个sql备份的还原后,发现系统的部分路径找不到,于是 ...

  8. mysql中,执行delete语句时出现Lock wait timeout exceeded问题

    问题描述: 当我插入一条记录时,在调用save方法的时候出现了异常(记录重复了),导致了后面的commit语句不能执行了.这时我在数据库中删除重复记录时发现该表已经被锁上了.即出现错误.但过了一会再次 ...

  9. Python连接MySQL数据库执行sql语句时的参数问题

    由于工作需要,今天写了一个Python小脚本,其中需要连接MySQL数据库,在执行sql命令时需要传递参数,结果出问题了.在网上查了一下,发现有以下几种方式传递参数: 一.直接把sql查询语句完整写入 ...

随机推荐

  1. angularjs中audio/video 路径赋值问题

    之前解决这个问题都是通过js的attr赋值解决的,但是也一直不明白为什么audio直接在HTML中赋值报错.解决方法就是通过添加$sce过滤效果 app.filter("trustUrl&q ...

  2. 【DOS】COPY命令

    一:文件复制COPY 指令说明:复制一个或更多文件到指定位置,可以合并文件 语法:COPY [/A/B] source[/A|/B] [+source [/A|/b] [+...]][destinat ...

  3. Proe/Creo 零件库mnu文件制作批处理

    proe零件库自定义时需要菜单文件mnu,百度了下网上还没有人制作,偶然间Google时在PTC论坛上看到一德国人分享了自己制作的bat文件用于对文件夹(及子文件夹)产生mnu文件,我在将他的文件翻译 ...

  4. LinuxMint 18.3禁用ipv6

    编辑/etc/sysctl.conf文件,添加如下内容 net.ipv6.conf.all.disable_all = 1 保存后执行 sudo sysctl -p 即可生效

  5. hadoop最新稳定版本使用建议

    Apache Hadoop Apache版本衍化比较快,我给大家介绍一下过程 ApacheHadoop版本分为两代,我们将第一代Hadoop称为Hadoop 1.0,第二代Hadoop称为Hadoop ...

  6. Hyperledger Fabric MSP Identity Validity Rules——MSP身份验证规则

    MSP Identity Validity Rules——MSP身份验证规则 正如Hyperledger Fabric Membership Service Providers (MSP)——成员服务 ...

  7. 1042 Shuffling Machine

    一.题目描述 Shuffling is a procedure used to randomize a deck of playing cards. Because standard shufflin ...

  8. PHP性能分析工具xdebug+qcachegrind

    先安装xdebug工具 pecl install xdebug 修改php.ini配置 [xdebug] zend_extension="xdebug.so" # profiler ...

  9. python将response中的cookies加入到header

    url = “http://abad.com”header = { "user-Agent" : "Mozilla/5.0 (Windows NT 10.0; Win64 ...

  10. servlet 和 threadlocal 与 web容器(理解threadlocal)

    同步机制采用了“以时间换空间”的方式,提供一份变量,让不同的线程排队访问.而ThreadLocal采用了“以空间换时间”的方式,为每一个线程都提供了一份变量的副本,从而实现同时访问而互不影响. htt ...