Knowing the latest mysql error

I am running a PHP script that does a lot of mysql work

At some point, mysql crashes without printing any errors.

I would like to go to mysql from the console and ask what was the last error.

How can i do this?

(I know php mysql_error (), but I am looking for a mysql command that I can run directly regardless of php script)

+5
source share
1 answer

You can run

SHOW ERRORS;

And similarly useful is:

SHOW WARNINGS;

EDIT

Apparently, this will only show errors (or warnings) from your own sessions. Therefore, I assume that this will not meet your goal (using the console to find the errors caused by php).

, ( -): http://dev.mysql.com/doc/refman/5.0/en/show-warnings.html

+5

All Articles