久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='xf4ja'></tfoot>

  • <legend id='xf4ja'><style id='xf4ja'><dir id='xf4ja'><q id='xf4ja'></q></dir></style></legend>

    <small id='xf4ja'></small><noframes id='xf4ja'>

      <bdo id='xf4ja'></bdo><ul id='xf4ja'></ul>

      1. <i id='xf4ja'><tr id='xf4ja'><dt id='xf4ja'><q id='xf4ja'><span id='xf4ja'><b id='xf4ja'><form id='xf4ja'><ins id='xf4ja'></ins><ul id='xf4ja'></ul><sub id='xf4ja'></sub></form><legend id='xf4ja'></legend><bdo id='xf4ja'><pre id='xf4ja'><center id='xf4ja'></center></pre></bdo></b><th id='xf4ja'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='xf4ja'><tfoot id='xf4ja'></tfoot><dl id='xf4ja'><fieldset id='xf4ja'></fieldset></dl></div>
      2. nodejs mysql 錯誤:連接丟失 服務器關閉了連接

        nodejs mysql Error: Connection lost The server closed the connection(nodejs mysql 錯誤:連接丟失 服務器關閉了連接)

          <tfoot id='vZgjd'></tfoot>
            <tbody id='vZgjd'></tbody>
          <i id='vZgjd'><tr id='vZgjd'><dt id='vZgjd'><q id='vZgjd'><span id='vZgjd'><b id='vZgjd'><form id='vZgjd'><ins id='vZgjd'></ins><ul id='vZgjd'></ul><sub id='vZgjd'></sub></form><legend id='vZgjd'></legend><bdo id='vZgjd'><pre id='vZgjd'><center id='vZgjd'></center></pre></bdo></b><th id='vZgjd'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='vZgjd'><tfoot id='vZgjd'></tfoot><dl id='vZgjd'><fieldset id='vZgjd'></fieldset></dl></div>
        • <legend id='vZgjd'><style id='vZgjd'><dir id='vZgjd'><q id='vZgjd'></q></dir></style></legend>

            • <bdo id='vZgjd'></bdo><ul id='vZgjd'></ul>
              • <small id='vZgjd'></small><noframes id='vZgjd'>

                  本文介紹了nodejs mysql 錯誤:連接丟失 服務器關閉了連接的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  當我使用node mysql時,在12:00到2:00之間出現一個錯誤,TCP連接被服務器關閉.這是完整的消息:

                  when I use node mysql, an error is appear between 12:00 to 2:00 that the TCP connection is shutdown by the server. This is the full message:

                  Error: Connection lost: The server closed the connection.
                  at Protocol.end (/opt/node-v0.10.20-linux-x64/IM/node_modules/mysql/lib/protocol/Protocol.js:73:13)
                  at Socket.onend (stream.js:79:10)
                  at Socket.EventEmitter.emit (events.js:117:20)
                  at _stream_readable.js:920:16
                  at process._tickCallback (node.js:415:13)
                  

                  有解決方案.但是,我按照這種方式嘗試后,問題也出現了.現在我不知道該怎么辦.有人遇到過這個問題嗎?

                  There is the solution. However, after I try by this way, the problem also appear. now I do not know how to do. Does anyone meet this problem?

                  這是我按照解決方案編寫的方式:

                  Here is the way I wrote follow the solution:

                      var handleKFDisconnect = function() {
                      kfdb.on('error', function(err) {
                          if (!err.fatal) {
                              return;
                          }
                          if (err.code !== 'PROTOCOL_CONNECTION_LOST') {
                              console.log("PROTOCOL_CONNECTION_LOST");
                              throw err;
                          }
                          log.error("The database is error:" + err.stack);
                  
                          kfdb = mysql.createConnection(kf_config);
                  
                          console.log("kfid");
                  
                          console.log(kfdb);
                          handleKFDisconnect();
                      });
                     };
                     handleKFDisconnect();
                  

                  推薦答案

                  嘗試使用這段代碼處理服務器斷開連接:

                  Try to use this code to handle server disconnect:

                  var db_config = {
                    host: 'localhost',
                      user: 'root',
                      password: '',
                      database: 'example'
                  };
                  
                  var connection;
                  
                  function handleDisconnect() {
                    connection = mysql.createConnection(db_config); // Recreate the connection, since
                                                                    // the old one cannot be reused.
                  
                    connection.connect(function(err) {              // The server is either down
                      if(err) {                                     // or restarting (takes a while sometimes).
                        console.log('error when connecting to db:', err);
                        setTimeout(handleDisconnect, 2000); // We introduce a delay before attempting to reconnect,
                      }                                     // to avoid a hot loop, and to allow our node script to
                    });                                     // process asynchronous requests in the meantime.
                                                            // If you're also serving http, display a 503 error.
                    connection.on('error', function(err) {
                      console.log('db error', err);
                      if(err.code === 'PROTOCOL_CONNECTION_LOST') { // Connection to the MySQL server is usually
                        handleDisconnect();                         // lost due to either server restart, or a
                      } else {                                      // connnection idle timeout (the wait_timeout
                        throw err;                                  // server variable configures this)
                      }
                    });
                  }
                  
                  handleDisconnect();
                  

                  在你的代碼中,我遺漏了 connection = mysql.createConnection(db_config);

                  In your code i am missing the parts after connection = mysql.createConnection(db_config);

                  這篇關于nodejs mysql 錯誤:連接丟失 服務器關閉了連接的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函數根據 N 個先前值來決定接下來的 N 個行)
                  reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用選擇表達式的結果;條款?)
                  Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函數的 ignore 選項是忽略整個事務還是只是有問題的行?) - IT屋-程序員軟件開發技
                  Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 時出錯,使用 for 循環數組)
                  pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 調用 o23.load 時發生錯誤 沒有合適的驅動程序)
                  How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何將 Apache Spark 與 MySQL 集成以將數據庫表作為 Spark 數據幀讀取?)

                1. <tfoot id='W7kss'></tfoot>

                    <i id='W7kss'><tr id='W7kss'><dt id='W7kss'><q id='W7kss'><span id='W7kss'><b id='W7kss'><form id='W7kss'><ins id='W7kss'></ins><ul id='W7kss'></ul><sub id='W7kss'></sub></form><legend id='W7kss'></legend><bdo id='W7kss'><pre id='W7kss'><center id='W7kss'></center></pre></bdo></b><th id='W7kss'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='W7kss'><tfoot id='W7kss'></tfoot><dl id='W7kss'><fieldset id='W7kss'></fieldset></dl></div>

                        <small id='W7kss'></small><noframes id='W7kss'>

                            <tbody id='W7kss'></tbody>
                            <bdo id='W7kss'></bdo><ul id='W7kss'></ul>
                            <legend id='W7kss'><style id='W7kss'><dir id='W7kss'><q id='W7kss'></q></dir></style></legend>
                            主站蜘蛛池模板: 91视频大全 | av网站免费看 | 国产精品久久久久久久久久 | 成人欧美一区二区三区在线播放 | 久久不射网 | 欧美天堂 | 国产精品亚洲一区二区三区在线 | 亚洲不卡 | 国产精品久久久久久久久图文区 | 九九热这里只有精品在线观看 | 亚洲精品高清视频在线观看 | 国产高清精品一区二区三区 | 欧美成人第一页 | 精品国产乱码久久久久久88av | 日本a视频 | 欧美日批 | 国产欧美一区二区三区在线播放 | 亚洲视频免费在线观看 | 亚洲精品乱码久久久久久按摩观 | 日韩在线中文字幕 | 日韩三级在线 | av影片在线 | 国产成人精品在线 | 成人教育av| xx性欧美肥妇精品久久久久久 | 欧美精品一区二区在线观看 | 人人插人人| 日韩免费一级 | 日本久久网站 | 久久精品国产精品青草 | 亚洲一区二区三区四区五区午夜 | 国产一区二区在线视频 | 91精品国产91久久久久久最新 | 欧美在线一区二区三区 | 91国内在线观看 | 国产成人久久精品 | 久久久久久久一区二区三区 | 国产精品99久久久久久动医院 | 日韩快播电影网 | 丁香婷婷综合激情五月色 | 青春草国产 |