• <noscript id="ecgc0"><kbd id="ecgc0"></kbd></noscript>
    <menu id="ecgc0"></menu>
  • <tt id="ecgc0"></tt>

    mysql怎么修改鎖記錄超時等待時間

    mysql數據庫超時期待時候過長,一個事務期待時候過長會造當作死鎖,怎么點竄期待時候了,我寫的經驗對你進修mysql有幫忙的話,給我投票、點贊或者保藏!

    1備份恢復表中的數據

    1數據庫怎么設置手動提交

    1數據庫時候戳

    東西/原料

    • mysql

    方式/步調

    1. 1

      登錄mysql,查看鎖記實期待時候:

      SHOW VARIABLES LIKE 'innodb_lock_wait_timeout';

      期待時候是50秒,

    2. 2

      把表中id=1的數據加鎖,另一個事務對記實點竄:

      SELECT * FROM chengshi WHERE id=1 FOR UPDATE;

    3. 3

      另一個用戶登錄mysql,點竄id=1的數據:

      UPDATE chengshi SET chengshi='安陽林州' WHERE id=1;

      超時退出 1min

    4. 4

      把超時期待時候點竄為5秒:

      SET innodb_lock_wait_timeout=5;

    5. 5

      查看鎖記實超時期待時候:

      SHOW VARIABLES LIKE 'innodb_lock_wait_timeout';

    6. 6

      另一個用戶點竄id=1的數據:

      UPDATE chengshi SET chengshi='安陽林州' WHERE id=1;

      期待時候7

    • 發表于 2019-03-09 20:01
    • 閱讀 ( 1393 )
    • 分類:其他類型

    你可能感興趣的文章

    相關問題

    0 條評論

    請先 登錄 后評論
    聯系我們:uytrv@hotmail.com 問答工具
  • <noscript id="ecgc0"><kbd id="ecgc0"></kbd></noscript>
    <menu id="ecgc0"></menu>
  • <tt id="ecgc0"></tt>
    久久久久精品国产麻豆