Myqltransactionrollbackexception deadlock found when trying to get lock

Source: Internet
Author: User

Connect to mysq remotely in Linux

Command:

Mysql-h "1.0.0.1"-u username-P

 

1. You can check the table_locks_waited and table_locks_immediate status variables to analyze the competition for table lock on the system: mysql> show status like 'table % '; + rows + ---------- + | variable_name | value | + ---------------------------- + ---------- + | table_locks_immediate | 105 | table_locks_waited | 3 | + rows + ---------- + 2 rows in SET (0.00 Sec) you can check the innodb_row_lock status variable to analyze the contention for row locks on the system: mysql> show status like 'Innodb _ row_lock % '; + bytes + ---------- + | variable_name | value | + bytes + ---------- + | bytes | 0 | innodb_row_lock_time | 2001 | bytes | 667 | innodb_row_lock_time_max | 845 | innodb_row_lock_waits | 3 + -------------------------------------- + ---------- + 5 rows in SET (0.00 Sec) in addition For nnodb tables, if you need to check the current lock Wait Status, you can set InnoDB monitors and view it through show InnoDB status. The setting method is: Create Table innodb_monitor (a int) engine = InnoDB; the monitor can be stopped by issuing the following statement: Drop table innodb_monitor; after the monitor is set, detailed information about the current lock wait will appear in the display content of show InnoDB status, including the table name, lock type, and lock record for further analysis and problem determination. After the monitor is enabled, the monitored content is recorded in the log every 15 seconds. If the monitor is enabled for a long time. the err file becomes very large, so after you confirm the cause of the problem, remember to delete the monitoring table to close the monitor. You can also use the -- console option to start the server to close the log file writing.


If it is a root account, you can see the current connection of all users. For other common accounts, you can only view the connections you are using. 
Show processlist; Only list the first 100 entries. If you want to list all entries, use Show full processlist; 
Mysql> show processlist; (very useful)

From: http://5iwww.blog.51cto.com/856039/340985

Myqltransactionrollbackexception deadlock found when trying to get lock

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.