• <i id='fmUNH'><tr id='fmUNH'><dt id='fmUNH'><q id='fmUNH'><span id='fmUNH'><b id='fmUNH'><form id='fmUNH'><ins id='fmUNH'></ins><ul id='fmUNH'></ul><sub id='fmUNH'></sub></form><legend id='fmUNH'></legend><bdo id='fmUNH'><pre id='fmUNH'><center id='fmUNH'></center></pre></bdo></b><th id='fmUNH'></th></span></q></dt></tr></i><div id='fmUNH'><tfoot id='fmUNH'></tfoot><dl id='fmUNH'><fieldset id='fmUNH'></fieldset></dl></div>
    <tfoot id='fmUNH'></tfoot>
  • <small id='fmUNH'></small><noframes id='fmUNH'>

        <legend id='fmUNH'><style id='fmUNH'><dir id='fmUNH'><q id='fmUNH'></q></dir></style></legend>

        • <bdo id='fmUNH'></bdo><ul id='fmUNH'></ul>

        如何显示在 MySQL 上执行的最后查询?

        时间:2023-08-19
        <i id='1xpVI'><tr id='1xpVI'><dt id='1xpVI'><q id='1xpVI'><span id='1xpVI'><b id='1xpVI'><form id='1xpVI'><ins id='1xpVI'></ins><ul id='1xpVI'></ul><sub id='1xpVI'></sub></form><legend id='1xpVI'></legend><bdo id='1xpVI'><pre id='1xpVI'><center id='1xpVI'></center></pre></bdo></b><th id='1xpVI'></th></span></q></dt></tr></i><div id='1xpVI'><tfoot id='1xpVI'></tfoot><dl id='1xpVI'><fieldset id='1xpVI'></fieldset></dl></div>
          <tbody id='1xpVI'></tbody>
        <legend id='1xpVI'><style id='1xpVI'><dir id='1xpVI'><q id='1xpVI'></q></dir></style></legend>

              <bdo id='1xpVI'></bdo><ul id='1xpVI'></ul>

              <small id='1xpVI'></small><noframes id='1xpVI'>

              • <tfoot id='1xpVI'></tfoot>
                  本文介绍了如何显示在 MySQL 上执行的最后查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  是否有任何查询/方法可以显示在所有服务器上执行的最后查询?

                  Is there any query/way to show the last queries executed on ALL servers?

                  推荐答案

                  对于那些拥有 MySQL >= 5.1.12 的人,你可以在运行时全局控制这个选项:

                  For those blessed with MySQL >= 5.1.12, you can control this option globally at runtime:

                  1. 执行SET GLOBAL log_output = 'TABLE';
                  2. 执行SET GLOBAL general_log = 'ON';
                  3. 看一下表mysql.general_log

                  如果您更喜欢输出到文件而不是表格:

                  If you prefer to output to a file instead of a table:

                  1. SET GLOBAL log_output = "FILE"; 默认.
                  2. SET GLOBAL general_log_file = "/path/to/your/logfile.log";
                  3. SET GLOBAL general_log = 'ON';

                  我更喜欢这种方法来编辑 .cnf 文件,因为:

                  I prefer this method to editing .cnf files because:

                  1. 您没有编辑 my.cnf 文件并可能永久开启日志记录
                  2. 您不是在文件系统中四处寻找查询日志——或者更糟的是,因为需要完美的目的地而分心./var/log/var/data/log /opt/home/mysql_savior/var
                  3. 您不必重新启动服务器并中断与它的任何当前连接.
                  4. 重新启动服务器会使您从开始的地方离开(默认情况下日志仍处于关闭状态)
                  1. you're not editing the my.cnf file and potentially permanently turning on logging
                  2. you're not fishing around the filesystem looking for the query log - or even worse, distracted by the need for the perfect destination. /var/log /var/data/log /opt /home/mysql_savior/var
                  3. You don't have to restart the server and interrupt any current connections to it.
                  4. restarting the server leaves you where you started (log is by default still off)

                  有关更多信息,请参阅MySQL 5.1 参考手册 - 服务器系统变量 - general_log

                  这篇关于如何显示在 MySQL 上执行的最后查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:错误 1452:无法添加或更新子行:外键约束失败 下一篇:哪里 vs 有

                  相关文章

                  最新文章

                      <small id='8wCYy'></small><noframes id='8wCYy'>

                      <legend id='8wCYy'><style id='8wCYy'><dir id='8wCYy'><q id='8wCYy'></q></dir></style></legend>
                    1. <tfoot id='8wCYy'></tfoot>
                        <bdo id='8wCYy'></bdo><ul id='8wCYy'></ul>

                    2. <i id='8wCYy'><tr id='8wCYy'><dt id='8wCYy'><q id='8wCYy'><span id='8wCYy'><b id='8wCYy'><form id='8wCYy'><ins id='8wCYy'></ins><ul id='8wCYy'></ul><sub id='8wCYy'></sub></form><legend id='8wCYy'></legend><bdo id='8wCYy'><pre id='8wCYy'><center id='8wCYy'></center></pre></bdo></b><th id='8wCYy'></th></span></q></dt></tr></i><div id='8wCYy'><tfoot id='8wCYy'></tfoot><dl id='8wCYy'><fieldset id='8wCYy'></fieldset></dl></div>