之前从来没有遇到过mysql死锁的问题,今天第一次,查看了很多博客,问题终于解决啦,在此特意记录和分享。
1.第一种方式:重启MySQL
因为MySQL的事务产生了死锁,刚开始我是直接重启MySQL,但是不行,编辑这条数据的时候,页面还是一直在加载,没反应。
第二种方式:
2.执行sql:
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_