关于:org.apache.ibatis.exceptions.PersistenceException:

I can’t delete it anyway when I delete it today

Sentences are fine, everything is fine

Then I found that it could not be deleted because of foreign keys

The solution is to delete foreign keys or use even and delete statements

org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`student`.`score`, CONSTRAINT `fk_score_student` FOREIGN KEY (`student_id`) REFERENCES `student` (`sid`))
### The error may exist in StudentMapper.xml
### The error may involve StudentMapper.delete-Inline
### The error occurred while setting parameters
### SQL: DELETE FROM student WHERE sid=?
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`student`.`score`, CONSTRAINT `fk_score_student` FOREIGN KEY (`student_id`) REFERENCES `student` (`sid`))

foreign key constraint fails (student.score, CONSTRAINT fk_score_student FOREIGN KEY (student_id) REFERENCES student

Guess you like

Origin blog.csdn.net/m0_49194578/article/details/111825712