mysql 怪异的有关问题,

mysql 怪异的有关问题,

mysql 怪异的问题,急。。

程序没有用事务进行处理过SQL。都是很普通的SQL文。请问为什么会出现这个问题??

MySql.Data.MySqlClient.MySqlException: Deadlock found when trying to get lock; try restarting transaction

  at MySql.Data.MySqlClient.MySqlStream.ReadPacket()

  at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId)

  at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId)

  at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId)

  at MySql.Data.MySqlClient.MySqlDataReader.NextResult()

  at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)

  at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()



Deadlock found when trying to get lock; try restarting transaction

需要访问并且进行操作的表,被别的事务锁住了,导致一直无法获得加锁的请求,而出现死锁

建议检查下是不是有表被某事务操作了而忘记执行commit了,或者你服务器端进行执行某操作,加了表级别的锁 或锁住很大范围的数据

#****************************************#

MySQL技术及运维自动化网:www.mysqlops.com

新浪微博账号:http://weibo.com/mysqlops

#****************************************#




你的SQL语句是什么,查询的什么表,是否有主键,SHOW PROCESSLIST看看



show innodb status看看




错误信息很明显,是表死锁。 发生问题的同时,另外通过工具连上数据库看一下 show processlists ,检查一下有哪些语句在执行,什么表被锁住了。




Deadlock found 

有死锁啊,看看日志,查你前面执行了什么操作。

mysql 怪异的有关问题,

相关文章:

你感兴趣的文章:

标签云: