---
title: "mysql 死锁"
author: "bernoulli"
date: "2016-09-03T16:54:52Z"
tags: []
categories: ["数据库"]
slug: "mysql"
draft: false
lastmod: "2017-02-25T15:59:22Z"
id: 2322485
url: "https://bernoulli.iteye.com/blog/2322485"
---

Enter MySQL

```sql
mysql -u your_user -p
```

2\) Let's see the list of locked tables

```sql
mysql> show open tables where in_use>0;
```

3\) Let's see the list of the current processes, one of them is locking your table(s)

```sql
mysql> show processlist;
```

4\) Kill one of these processes

```sql
mysql>kill put_process_id_here;


```

```
select concat('KILL ',id,';') from information_schema.processlist where user='root';
+------------------------+
| concat('KILL ',id,';') 
+------------------------+
| KILL 3101;             
| KILL 2946;             
```

```sql

```