zoukankan      html  css  js  c++  java
  • 数据库死锁

    SELECT * FROM information_schema.INNODB_TRX;

    最近在维护数据库时,解析数据时候,数据一直不能入库。原因知道,是因为MySQL的事务产生了死锁,前几次我直接重启MySQL。
      www.2cto.com  
    最近发现频繁的出现。所以找到一种方法。
    SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX;  
     
    trx_id trx_state trx_started trx_requested_lock_id trx_wait_started trx_weight trx_mysql_thread_id trx_query trx_operation_state trx_tables_in_use trx_tables_locked trx_lock_structs trx_lock_memory_bytes trx_rows_locked trx_rows_modified trx_concurrency_tickets trx_isolation_level trx_unique_checks trx_foreign_key_checks trx_last_foreign_key_error trx_adaptive_hash_latched trx_adaptive_hash_timeouttrx_id trx_state trx_started trx_requested_lock_id trx_wait_started trx_weight trx_mysql_thread_id trx_query trx_operation_state trx_tables_in_use trx_tables_locked trx_lock_structs trx_lock_memory_bytes trx_rows_locked trx_rows_modified trx_concurrency_tickets trx_isolation_level trx_unique_checks trx_foreign_key_checks trx_last_foreign_key_error trx_adaptive_hash_latched trx_adaptive_hash_timeout
      www.2cto.com  
    查看事件比较久的事物。如何当前时间select sysdate();AM 10:07而事物开始的时间是:AM 9:50,显示是不正常的。根据这个事物的线程ID(trx_mysql_thread_id)。
    执行命令:
    kill 线程ID  
    数据库修复正常。
     
    查看正在锁的事务
    SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS;  
     
    查看等待锁的事务
    SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS; 
  • 相关阅读:
    中值滤波与图像锐化
    空间域图像增强
    图像的几何变换
    Fourier分析应用
    Gale-Shapley算法
    有理数与无限循环小数
    线性可分支持向量机
    拉格朗日乘子法+KKT条件
    点到平面的距离
    BP神经网络
  • 原文地址:https://www.cnblogs.com/root429/p/9251343.html
Copyright © 2011-2022 走看看