Insert in MariaDB giving timeout

1

What reasons would it take for the simple insert described below to take so long that it even timeout the server?

INSERT INTO wkvmk_postmeta (post_id, meta_key, meta_value) VALUES(904, '_order_key', '')

Table structure:

+------------+---------------------+------+-----+---------+----------------+
| Field      | Type                | Null | Key | Default | Extra          |
+------------+---------------------+------+-----+---------+----------------+
| meta_id    | bigint(20) unsigned | NO   | PRI | NULL    | auto_increment |
| post_id    | bigint(20) unsigned | NO   | MUL | 0       |                |
| meta_key   | varchar(255)        | YES  | MUL | NULL    |                |
| meta_value | longtext            | YES  |     | NULL    |                |
+------------+---------------------+------+-----+---------+----------------+

Number of records already recorded: 5729

Server type: MariaDB

Server version: 10.0.24-MariaDB - MariaDB Server

Protocol version: 10

Error message: ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

Doing insert directly with a client in the console ( mariadb-client-10.0 )

    
asked by anonymous 28.11.2017 / 14:55

1 answer

1

Make sure your connection is not running with a process that might be affecting your database:

SHOW FULL PROCESSLIST;

You can kill the process using the command:

KILL [ID_PROCESSO]

A transaction that started and did not receive a commit can crash a process and kill it as described above resolves!

    
28.11.2017 / 15:16