久久久久久久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ì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

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

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

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

                  推薦答案

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

                  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)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(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è)先前值來決定接下來的 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ù)還是只是有問題的行?) - IT屋-程序員軟件開發(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ò)誤 沒有合適的驅(qū)動(dòng)程序)
                  How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何將 Apache Spark 與 MySQL 集成以將數(shù)據(jù)庫表作為 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>
                            主站蜘蛛池模板: 偷拍自拍在线观看 | 欧美一卡二卡在线观看 | 日韩三级 | 欧美伊人 | 国产一区二区三区免费视频 | 瑞克和莫蒂第五季在线观看 | 一级在线视频 | 日日夜夜天天 | 亚洲免费在线视频 | 久久久精彩视频 | 国精品一区 | 免费视频一区二区 | 成人1区| av中文字幕在线观看 | 美女131mm久久爽爽免费 | 国产精品久久久久久久久免费丝袜 | 国产精品久久久久久久粉嫩 | 日韩中文在线视频 | 日韩在线精品 | 久久精品国产v日韩v亚洲 | 亚洲一区在线播放 | 欧美成人aaa级毛片在线视频 | 神马久久av | 中文字幕乱码一区二区三区 | 91视视频在线观看入口直接观看 | 最新国产精品 | 午夜在线精品偷拍 | 久久大 | 波多野结衣一二三区 | 精品国产精品三级精品av网址 | 四虎影院免费在线 | 亚洲成人自拍 | 色片在线观看 | 欧美日韩a | 91精品国产一区二区三区 | 日韩免费激情视频 | 北条麻妃国产九九九精品小说 | 婷婷去俺也去 | 亚洲日韩欧美一区二区在线 | 国产精品久久久久久久一区探花 | 免费在线看黄 |