Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

If a script triggers an error in mysql, then you want to loggin in mysql cli to know more, nevertheless, mysql show warning/errors commands show only errors for the current session. Since the error was triggered by a script, there's no chance these commands show anything.

Yet, when there's an error from a foreign key, you can always do SHOW ENGINE INNODB STATUS and check for the LATEST FOREIGN KEY ERROR section. Like so :

SHOW ENGINE INNODB STATUS
------------------------
LATEST FOREIGN KEY ERROR
------------------------
141215 22:11:15 Error in foreign key constraint of table buzut/#sql-6b09_41276:
FOREIGN KEY (articles_id) REFERENCES Articles(id) ON DELETE SET NULL:
You have defined a SET NULL condition though some of the
columns are defined as NOT NULL.

Is there any workaround to do the same for any type of error ?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.