能不能通过什么方式查到到 mysql 到底查找 执行了 哪些SQL语句

解决方案 »

  1.   


    可以,你去查询下mysql的general-query-log日志,里面有记录的。
      

  2.   

    在mysql的配置文件里的mysqld 选项组里面加一个参数:log= path/query.log 这里面就都是你的查询语句了;
      

  3.   

    看看这一段:5.10.2. The General Query Log
    If you want to know what happens within mysqld, you should start it with the --log[=file_name] or -l [file_name] option. If no file_name value is given, the default name is host_name.log This logs all connections and statements to the log file. This log can be very useful when you suspect an error in a client and want to know exactly what the client sent to mysqld. 使用的就是log参数
      

  4.   

    看你的查询日志是否打开
    mysql> show variables like 'log';
    +---------------+-------+
    | Variable_name | Value |
    +---------------+-------+
    | log           | ON    |
    +---------------+-------+
    1 row in set
    如果没有,在配置文件中加log=/home/hostname.log