The reason is the constraint of Foreign Key. After shutting down the Foreign Key check, the SQL table was deleted successfully:
Set FOREIGN_KEY_CHECKS = 0; Turn off the Foreign Key inspection
Drop table Table_Name;
The Set FOREIGN_KEY_CHECKS = 1; Resume Foreign Key inspection
Set FOREIGN_KEY_CHECKS = 0; Turn off the Foreign Key inspection
Drop table Table_Name;
The Set FOREIGN_KEY_CHECKS = 1; Resume Foreign Key inspection
Read More:
- MYSQL ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails
- Mysql error 1452 – Cannot add or update a child row: a foreign key constraint fails
- MySQL error code 1217 (ER_ROW_IS_REFERENCED): Cannot delete or update a parent row: a foreign key co
- MySQL failed to add foreign key: SQL 1452 cannot add or update a child row:a foreign key constraint fails
- Solution to error 1452: cannot add or update a child row: a foreign key constraint failures in MySQL
- MySql ERROR CODE:1215 Cannot add the foreign key constraint
- MySQL:Foreign key fails with error Error Code: 1452.
- Failed to add the foreign key constraint. Missing index for constraint ‘stu_ibfk_1’ in the reference
- 1822 – Failed to add the foreign key constraint. Missing index for constraint ‘tb_emp_ibfk_1’ in the
- MySQL error 1451 23000 foreign key exception handling
- mysql Error Code: 1022. Can’t write; duplicate key in table `xxx`
- MySQL failed to add foreign key error 1452
- Ora-02292: integrity constraint (XX) violated – child record found foreign key Association, record cannot be deleted
- Matlab delete row or col to delete the row or column of the matrix
- [Solved] Es delete all the data in the index without deleting the index structure, including curl deletion
- MySQL error: can’t create table ‘..’( errno:150 )Solutions
- greendao insert data UNIQUE constraint failed: PURCHASE_ORDER_TABLE._id (code 1555)
- Insert into / delete / update / select of SQL Server database table
- Lua — using remove to delete table data
- 1093 – You can’t specify target table ‘table’ for update in FROM clause