You can use the
SHOW WARNINGS
statement in MySQL to show
the error, warning, and note messages that resulted from the last
statement that generated messages in the current session. It shows nothing
if the last statement used a table and generated no messages. (That is, a
statement that uses a table but generates no messages clears the message
list.) Statements that do not use tables and do not generate messages
have no effect on the message list.
For example, if I issue the statement DROP TABLE IF EXISTS
smf_testing
statement as below, I see a notice that 0 rows were
affected, but there was 1 warning. To see the warning, I can immediately
afterwards issue the statement SHOW WARNINGS
. I see that the
warning was simply indicating that the table I asked be dropped, didn't
actually exist.
mysql> DROP TABLE IF EXISTS smf_testing; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> SHOW WARNINGS; +-------+------+-----------------------------+ | Level | Code | Message | +-------+------+-----------------------------+ | Note | 1051 | Unknown table 'smf_testing' | +-------+------+-----------------------------+ 1 row in set (0.00 sec) mysql>
References: