Turnoff mysql unsafe statement warning

↘锁芯ラ 提交于 2019-12-05 04:33:36

You can use

SET GLOBAL LOG_WARNINGS = 0 

to turn off logging and

SET GLOBAL LOG_WARNINGS = 1

to turn it back on. My personal suggestion is to wrap the offending query with these rather than setting it globally so that you can track if other queries cause the problem as well.

Note that older versions of MySQL do not support this.

I think this question is still open. Use set max_error_count=0; your unsafe queries; set max_error_count=64;

before the queries you want to run it is a session variable, so you don't need to be super user to use. Not only, no warnings will be issued when you call show warnings limit 5; but such warnings are not reporting in mysql log files. you can also use it in stored procedures. After your queries you know that are unsafe, you can put back this variable to its original value.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!