<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ## 慢查詢日志 慢日志記錄執行時間過長和沒有使用索引的查詢語句,報錯select、update、delete以及insert語句,慢日志只會記錄執行成功的語句。 ### 1. 查看慢查詢時間: ``` show variables like "long_query_time";默認10s ``` ![](https://img.kancloud.cn/0b/25/0b2552f354dc576a878f2e1d1d02b63f_379x106.png) ### 2. 查看慢查詢配置情況: ``` show status like "%slow_queries%"; ```   ![](https://img.kancloud.cn/93/39/93399b95714ff09ef562a1283130c23d_359x105.png) ### 3. 查看慢查詢日志路徑: ``` show variables like "%slow%"; ``` ![](https://img.kancloud.cn/7c/a7/7ca7eba586583ce011ca80a52e5fbebf_618x160.png) ### 4. 開啟慢日志 ``` set global slow_query_log=1; ``` ![](https://img.kancloud.cn/48/e2/48e2fa3a307980f692c1a8d19fd9af0a_304x49.png)    ### 5. 查看已經開啟: ``` show variables like "slow_query_log"; show variables like "%slow_query_log%"; ```   ![](https://img.kancloud.cn/b6/67/b667f6c1ee563920ce44dca18c4bed19_570x119.png) ### 6、查看是否開啟記錄未使用索引的查詢: ``` show variables like 'log_queries_not_using_indexes'; ``` ### 7、開啟未使用索引的查詢日志: ``` set global log_queries_not_using_indexes=on; ``` ### 8、查看慢查詢日志記錄位置: ``` show variables like 'slow_query_log_file'; ``` ### 9、shell 查看慢查詢日志: ``` tail -f /var/lib/mysql/e3edd0de9e5d-slow.log; ``` ![](https://img.kancloud.cn/71/17/7117a348de296af38b1155702ae071a4_1406x716.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看