Error code: 1100 Table ' T_depart_info ' is not locked with LOCK tables Solution _ Database Other

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.