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

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

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

    1. <tfoot id='aaEwY'></tfoot><legend id='aaEwY'><style id='aaEwY'><dir id='aaEwY'><q id='aaEwY'></q></dir></style></legend>
          <bdo id='aaEwY'></bdo><ul id='aaEwY'></ul>
      1. 如何調(diào)試 MySQL 上超出的鎖定等待超時(shí)?

        How to debug Lock wait timeout exceeded on MySQL?(如何調(diào)試 MySQL 上超出的鎖定等待超時(shí)?)
          <tbody id='E5yN9'></tbody>
              <bdo id='E5yN9'></bdo><ul id='E5yN9'></ul>

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

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

                  本文介紹了如何調(diào)試 MySQL 上超出的鎖定等待超時(shí)?的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  在我的生產(chǎn)錯(cuò)誤日志中,我偶爾會(huì)看到:

                  In my production error logs I occasionally see:

                  SQLSTATE[HY000]:一般錯(cuò)誤:1205超過鎖等待超時(shí);嘗試重啟事務(wù)

                  SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction

                  我知道那個(gè)時(shí)候哪個(gè)查詢正在嘗試訪問數(shù)據(jù)庫,但是有沒有辦法找出哪個(gè)查詢在那個(gè)精確的時(shí)刻鎖定了?

                  I know which query is trying to access the database at that moment but is there a way to find out which query had the lock at that precise moment?

                  推薦答案

                  是什么讓這一切成為了事務(wù)這個(gè)詞.從語句中可以看出查詢試圖更改一個(gè)或多個(gè) InnoDB 表中的至少一行.

                  What gives this away is the word transaction. It is evident by the statement that the query was attempting to change at least one row in one or more InnoDB tables.

                  既然您知道查詢,那么所有被訪問的表都可能成為罪魁禍?zhǔn)?

                  Since you know the query, all the tables being accessed are candidates for being the culprit.

                  從那里,您應(yīng)該能夠運(yùn)行 SHOW ENGINE INNODB STATUS\G

                  From there, you should be able to run SHOW ENGINE INNODB STATUS\G

                  您應(yīng)該能夠看到受影響的表

                  You should be able to see the affected table(s)

                  您可以獲得各種額外的鎖定和互斥信息.

                  You get all kinds of additional Locking and Mutex Information.

                  這是我的一位客戶的示例:

                  Here is a sample from one of my clients:

                  mysql> show engine innodb status\G
                  *************************** 1. row ***************************
                    Type: InnoDB
                    Name:
                  Status:
                  =====================================
                  110514 19:44:14 INNODB MONITOR OUTPUT
                  =====================================
                  Per second averages calculated from the last 4 seconds
                  ----------
                  SEMAPHORES
                  ----------
                  OS WAIT ARRAY INFO: reservation count 9014315, signal count 7805377
                  Mutex spin waits 0, rounds 11487096053, OS waits 7756855
                  RW-shared spins 722142, OS waits 211221; RW-excl spins 787046, OS waits 39353
                  ------------------------
                  LATEST FOREIGN KEY ERROR
                  ------------------------
                  110507 21:41:35 Transaction:
                  TRANSACTION 0 606162814, ACTIVE 0 sec, process no 29956, OS thread id 1223895360 updating or deleting, thread declared inside InnoDB 499
                  mysql tables in use 1, locked 1
                  14 lock struct(s), heap size 3024, 8 row lock(s), undo log entries 1
                  MySQL thread id 3686635, query id 124164167 10.64.89.145 viget updating
                  DELETE FROM file WHERE file_id in ('6dbafa39-7f00-0001-51f2-412a450be5cc' )
                  Foreign key constraint fails for table `backoffice`.`attachment`:
                  ,
                    CONSTRAINT `attachment_ibfk_2` FOREIGN KEY (`file_id`) REFERENCES `file` (`file_id`)
                  Trying to delete or update in parent table, in index `PRIMARY` tuple:
                  DATA TUPLE: 17 fields;
                   0: len 36; hex 36646261666133392d376630302d303030312d353166322d343132613435306265356363; asc 6dbafa39-7f00-0001-51f2-412a450be5cc;; 1: len 6; hex 000024214f7e; asc   $!O~;; 2: len 7; hex 000000400217bc; asc    @   ;; 3: len 2; hex 03e9; asc   ;; 4: len 2; hex 03e8; asc   ;; 5: len 36; hex 65666635323863622d376630302d303030312d336632662d353239626433653361333032; asc eff528cb-7f00-0001-3f2f-529bd3e3a302;; 6: len 40; hex 36646234376337652d376630302d303030312d353166322d3431326132346664656366352e6d7033; asc 6db47c7e-7f00-0001-51f2-412a24fdecf5.mp3;; 7: len 21; hex 416e67656c73204e6f7720436f6e666572656e6365; asc Angels Now Conference;; 8: len 34; hex 416e67656c73204e6f7720436f6e666572656e6365204a756c7920392c2032303131; asc Angels Now Conference July 9, 2011;; 9: len 1; hex 80; asc  ;; 10: len 8; hex 8000124a5262bdf4; asc    JRb  ;; 11: len 8; hex 8000124a57669dc3; asc    JWf  ;; 12: SQL NULL; 13: len 5; hex 8000012200; asc    " ;; 14: len 1; hex 80; asc  ;; 15: len 2; hex 83e8; asc   ;; 16: len 4; hex 8000000a; asc     ;;
                  
                  But in child table `backoffice`.`attachment`, in index `PRIMARY`, there is a record:
                  PHYSICAL RECORD: n_fields 6; compact format; info bits 0
                   0: len 30; hex 36646261666133392d376630302d303030312d353166322d343132613435; asc 6dbafa39-7f00-0001-51f2-412a45;...(truncated); 1: len 30; hex 38666164663561652d376630302d303030312d326436612d636164326361; asc 8fadf5ae-7f00-0001-2d6a-cad2ca;...(truncated); 2: len 6; hex 00002297b3ff; asc   "   ;; 3: len 7; hex 80000040070110; asc    @   ;; 4: len 2; hex 0000; asc   ;; 5: len 30; hex 416e67656c73204e6f7720436f6e666572656e636520446f63756d656e74; asc Angels Now Conference Document;;
                  
                  ------------
                  TRANSACTIONS
                  ------------
                  Trx id counter 0 620783814
                  Purge done for trx's n:o < 0 620783800 undo n:o < 0 0
                  History list length 35
                  LIST OF TRANSACTIONS FOR EACH SESSION:
                  ---TRANSACTION 0 0, not started, process no 29956, OS thread id 1192212800
                  MySQL thread id 5341758, query id 189708501 127.0.0.1 lwdba
                  show innodb status
                  ---TRANSACTION 0 620783788, not started, process no 29956, OS thread id 1196472640
                  MySQL thread id 5341773, query id 189708353 10.64.89.143 viget
                  ---TRANSACTION 0 0, not started, process no 29956, OS thread id 1223895360
                  MySQL thread id 5341667, query id 189706152 10.64.89.145 viget
                  ---TRANSACTION 0 0, not started, process no 29956, OS thread id 1227888960
                  MySQL thread id 5341556, query id 189699857 172.16.135.63 lwdba
                  ---TRANSACTION 0 620781112, not started, process no 29956, OS thread id 1222297920
                  MySQL thread id 5341511, query id 189696265 10.64.89.143 viget
                  ---TRANSACTION 0 620783736, not started, process no 29956, OS thread id 1229752640
                  MySQL thread id 5339005, query id 189707998 10.64.89.144 viget
                  ---TRANSACTION 0 620783785, not started, process no 29956, OS thread id 1198602560
                  MySQL thread id 5337583, query id 189708349 10.64.89.145 viget
                  ---TRANSACTION 0 620783469, not started, process no 29956, OS thread id 1224161600
                  MySQL thread id 5333500, query id 189708478 10.64.89.144 viget
                  ---TRANSACTION 0 620781240, not started, process no 29956, OS thread id 1198336320
                  MySQL thread id 5324256, query id 189708493 10.64.89.145 viget
                  ---TRANSACTION 0 617458223, not started, process no 29956, OS thread id 1195141440
                  MySQL thread id 736, query id 175038790 Has read all relay log; waiting for the slave I/O thread to update it
                  --------
                  FILE I/O
                  --------
                  I/O thread 0 state: waiting for i/o request (insert buffer thread)
                  I/O thread 1 state: waiting for i/o request (log thread)
                  I/O thread 2 state: waiting for i/o request (read thread)
                  I/O thread 3 state: waiting for i/o request (write thread)
                  Pending normal aio reads: 0, aio writes: 0,
                   ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
                  Pending flushes (fsync) log: 0; buffer pool: 0
                  519878 OS file reads, 18962880 OS file writes, 13349046 OS fsyncs
                  0.00 reads/s, 0 avg bytes/read, 6.25 writes/s, 4.50 fsyncs/s
                  -------------------------------------
                  INSERT BUFFER AND ADAPTIVE HASH INDEX
                  -------------------------------------
                  Ibuf: size 1, free list len 1190, seg size 1192,
                  174800 inserts, 174800 merged recs, 54439 merges
                  Hash table size 35401603, node heap has 35160 buffer(s)
                  0.50 hash searches/s, 11.75 non-hash searches/s
                  ---
                  LOG
                  ---
                  Log sequence number 28 1235093534
                  Log flushed up to   28 1235093534
                  Last checkpoint at  28 1235091275
                  0 pending log writes, 0 pending chkp writes
                  12262564 log i/o's done, 3.25 log i/o's/second
                  ----------------------
                  BUFFER POOL AND MEMORY
                  ----------------------
                  Total memory allocated 18909316674; in additional pool allocated 1048576
                  Dictionary memory allocated 2019632
                  Buffer pool size   1048576
                  Free buffers       175763
                  Database pages     837653
                  Modified db pages  6
                  Pending reads 0
                  Pending writes: LRU 0, flush list 0, single page 0
                  Pages read 770138, created 108485, written 7795318
                  0.00 reads/s, 0.00 creates/s, 4.25 writes/s
                  Buffer pool hit rate 1000 / 1000
                  --------------
                  ROW OPERATIONS
                  --------------
                  0 queries inside InnoDB, 0 queries in queue
                  1 read views open inside InnoDB
                  Main thread process no. 29956, id 1185823040, state: sleeping
                  Number of rows inserted 6453767, updated 4602534, deleted 3638793, read 388349505551
                  0.25 inserts/s, 1.25 updates/s, 0.00 deletes/s, 2.75 reads/s
                  ----------------------------
                  END OF INNODB MONITOR OUTPUT
                  ============================
                  
                  1 row in set, 1 warning (0.00 sec)
                  

                  您應(yīng)該考慮通過設(shè)置 innodb_lock_wait_timeout,默認(rèn)為 50 秒

                  You should consider increasing the lock wait timeout value for InnoDB by setting the innodb_lock_wait_timeout, default is 50 sec

                  mysql> show variables like 'innodb_lock_wait_timeout';
                  +--------------------------+-------+
                  | Variable_name            | Value |
                  +--------------------------+-------+
                  | innodb_lock_wait_timeout | 50    |
                  +--------------------------+-------+
                  1 row in set (0.01 sec)
                  

                  你可以在/etc/my.cnf中永久設(shè)置為更高的值

                  You can set it to higher value in /etc/my.cnf permanently with this line

                  [mysqld]
                  innodb_lock_wait_timeout=120
                  

                  并重新啟動(dòng) mysql.如果此時(shí)無法重啟mysql,請運(yùn)行:

                  and restart mysql. If you cannot restart mysql at this time, run this:

                  SET GLOBAL innodb_lock_wait_timeout = 120; 
                  

                  您也可以在會(huì)話期間設(shè)置它

                  You could also just set it for the duration of your session

                  SET innodb_lock_wait_timeout = 120; 
                  

                  關(guān)注您的查詢

                  這篇關(guān)于如何調(diào)試 MySQL 上超出的鎖定等待超時(shí)?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(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ù)幀讀取?)
                      <tbody id='5QSxg'></tbody>

                      <bdo id='5QSxg'></bdo><ul id='5QSxg'></ul>

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

                        <small id='5QSxg'></small><noframes id='5QSxg'>

                          • 主站蜘蛛池模板: 狠狠狠干| 国产一区三区视频 | 精品一区二区三区在线视频 | 亚洲欧美激情精品一区二区 | 久久国产精品视频 | 91av导航 | 精品国产99 | 超碰人人做 | 久草免费在线视频 | 亚洲久久在线 | 波多野结衣二区 | 国产精品毛片无码 | 欧美成人激情视频 | 国产在线观看不卡一区二区三区 | 中文字幕在线网 | 久久久高清 | 亚洲国产精品va在线看黑人 | 亚洲一页| 中文字幕一级毛片视频 | 免费精品| 99精品久久久久久 | www国产亚洲精品 | av天天看 | 久久国产精品无码网站 | 欧美精品综合在线 | 粉嫩粉嫩芽的虎白女18在线视频 | 国产91在线观看 | 91视频在线看 | 免费一级欧美在线观看视频 | 日韩欧美中文字幕在线视频 | 一级看片免费视频囗交动图 | 亚洲国产精品久久久 | 国产精品综合视频 | 日韩免费在线 | 欧美日韩国产一区二区三区不卡 | 日韩视频在线免费观看 | 成人在线电影网站 | 精品欧美一区二区精品久久 | 国产婷婷精品 | h在线免费观看 | 欧美一区精品 |