久久久久久久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 錯(cuò)誤:連接丟失 服務(wù)器關(guān)閉了連接

        nodejs mysql Error: Connection lost The server closed the connection(nodejs mysql 錯(cuò)誤:連接丟失 服務(wù)器關(guān)閉了連接)

          <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 錯(cuò)誤:連接丟失 服務(wù)器關(guān)閉了連接的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  當(dāng)我使用node mysql時(shí),在12:00到2:00之間出現(xiàn)一個(gè)錯(cuò)誤,TCP連接被服務(wù)器關(guān)閉.這是完整的消息:

                  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)
                  

                  有解決方案.但是,我按照這種方式嘗試后,問(wèn)題也出現(xiàn)了.現(xiàn)在我不知道該怎么辦.有人遇到過(guò)這個(gè)問(wèn)題嗎?

                  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?

                  這是我按照解決方案編寫(xiě)的方式:

                  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();
                  

                  推薦答案

                  嘗試使用這段代碼處理服務(wù)器斷開(kāi)連接:

                  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);

                  這篇關(guān)于nodejs mysql 錯(cuò)誤:連接丟失 服務(wù)器關(guān)閉了連接的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

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

                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>
                            主站蜘蛛池模板: 97免费在线视频 | 欧美国产日韩一区二区三区 | 欧美精品一区二区三区在线 | 中文字幕动漫成人 | 国产精品一区二区欧美黑人喷潮水 | 精品久久久久国产免费第一页 | 亚洲国产成人久久综合一区,久久久国产99 | 鲁大师一区影视 | www.日韩高清 | 狠狠躁天天躁夜夜躁婷婷老牛影视 | 国产精品爱久久久久久久 | av毛片免费 | 日韩av最新网址 | 日本一道本 | 伊人免费网 | 午夜精品久久久 | 成人在线观看网站 | 国产九九精品视频 | 久久久久一区二区三区四区 | 91精品观看| 国产成人网 | 欧美 视频 | 91成人免费 | www.亚洲一区二区 | 亚洲精品在线91 | 久久久www成人免费精品 | 亚洲精品乱码久久久久久蜜桃91 | 国产精品久久久久久久毛片 | 日屁视频 | 欧美国产中文字幕 | 伊人久久免费视频 | 精久久久久 | 羞羞色影院 | 亚洲欧洲日韩精品 中文字幕 | 毛片毛片毛片毛片毛片 | 国产成人叼嘿视频在线观看 | 久久欧美高清二区三区 | 欧美天堂在线观看 | 精品一区二区久久久久久久网站 | 一区二区三区四区在线视频 | 成人九区 |