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