欢迎投稿

今日深度:

数据库锁表的查询和解锁,

数据库锁表的查询和解锁,


平常操作数据库时,由于程序设计和事务等原因导致锁表,下面是查看锁表和解锁的的情况:

百度的方法

查询是否锁表:show open tables where In_use>0;

查询进程:show processlist

杀掉进程 == kill 进程id

查看锁的事务  :select * from information_schema.innodb_locks;

查看等待锁的事务: select *  from information_schema.innodb_locks_watis;

 

自己平常使用的方法

查看数据库锁表的进程:select * from information_schema.innodb_trx;

杀掉进程:kill  trx_mysql_thread_id(查询出来的进程id)

 

www.htsjk.Com true http://www.htsjk.com/teradata/31149.html NewsArticle 数据库锁表的查询和解锁, 平常操作数据库时,由于程序设计和事务等原因导致锁表,下面是查看锁表和解锁的的情况: 百度的方法 查询是否锁表:show open tables where In_use0; 查询进程...
相关文章
    暂无相关文章
评论暂时关闭