Step by step to analyze the cause of the error code generation, we have to be patient oh.
First step, error description
1 queries executed, 0 success, 1 errors, 0 warnings
query: INSERT INTO EMP values (one, ' H ', 23, ' female ')
error code: 1100
Table ' T_depart_info ' is not locked with LOCK TABLES
time Consuming: 0 sec
Delivery: 0 sec
The second step, the cause of the error
Lock the EMP database table read: Lock table EMP Read;
Inserts data into the EMP and invokes the trigger Insert_data
DELIMITER $$ use
' test ' $$
DROP TRIGGER/*!50032 IF EXISTS/' insert_data ' $$
CREATE
/*!50017 Definer = ' root ' @ ' localhost '/
TRIGGER ' Insert_data ' before insert on ' emp ' for each
ROW BEGIN
INSERT INTO T_depart_info (Id,depart_name,depart_teacher) VALUES (7, ' Hai ', ' Hugang ');
End;
$$
The third step, the solution (very simple)
Release Lock UNLOCK TABLES;
In fact, in the face of the error code, we follow the above three steps, the problem will be solved, to be good at discovering problems and solving problems.