数据库锁表问题
sqlserver解决锁表问题:
select request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName
from sys.dm_tran_locks where resource_type='OBJECT'
spid:进程Id;tableName :被锁表名; 解决:kill spid
mysql 中解决锁表问题:
查看哪些表被锁了:
show OPEN TABLES where In_use > 0;
查看锁表的进程
SELECT * FROM information_schema.innodb_trx;
查看所有进程
show processlist;
删出进程
kill 1085850;