
I just ran a simple MySQL CREATE TABLE statement that produced the line
"Query OK, 0 rows affected, 1 warning (0.07 sec)."
It didn't actually show me what the warning was, though. How can you see the contents of a warning that just occurred? I'm using MySQL 5.1, if it makes a difference. The only thing I found online was "SHOW WARNINGS;" but that only produced
"Empty set (0.00 sec)."
解决方案
SHOW WARNINGS is the only method I'm aware of, but you have to run it immediately after a query that had warnings attached to it. If you ran any other queries in between, or dropped the connection, then SHOW WARNINGS won't work.
The MySQL manual page for SHOW WARNINGS doesn't indicate any other methods, so I'm fairly certain that you're stuck with it.
MySQL警告查看技巧
本文介绍如何在MySQL中正确查看查询产生的警告信息。当执行如CREATE TABLE等操作时,可能会遇到未明确显示的警告。文章详细解释了使用SHOW WARNINGS命令的正确时机及限制条件。
6922

被折叠的 条评论
为什么被折叠?



