如何显示刚刚发生的MySQL警告? [英] How do I show a MySQL warning that just happened?

查看:178
本文介绍了如何显示刚刚发生的MySQL警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是运行了一个简单的MySQL CREATE TABLE语句,就可以生成该行

I just ran a simple MySQL CREATE TABLE statement that produced the line

查询确定,受影响0行,1警告(0.07秒)."

"Query OK, 0 rows affected, 1 warning (0.07 sec)."

不过,它实际上并没有告诉我警告是什么.您如何查看刚刚发生的警告的内容?我正在使用MySQL 5.1,如果有帮助的话.我在网上唯一发现的是"SHOW WARNINGS;但这只会产生

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

清空(0.00秒)."

"Empty set (0.00 sec)."

推荐答案

SHOW WARNINGS是我所知道的唯一方法,但是您必须在附加了警告的查询后立即运行它.如果您在两者之间运行任何其他查询,或者断开了连接,则SHOW WARNINGS将不起作用.

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.

SHOW警告的MySQL手册页没有不会指出任何其他方法,因此,我可以肯定地说,您会坚持使用它.

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警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆