How to enable mysql strict mode globally and have it stay on?

徘徊边缘 提交于 2019-12-23 08:49:22

问题


How do I enable MySQL strict mode globally, and have it stay on?

I have tried these commands:

SET sql_mode = TRADITIONAL;
SET sql_mode = ANSI_QUOTES;

But they only set the mode for the current session.


回答1:


To set the SQL mode at server startup, use: - the --sql-mode="modes" option on the command line, or - sql-mode="modes" in an option file such as my.cnf (Unix operating systems) or my.ini (Windows). ("modes" is a list of different modes separated by commas.)

Reference: https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html



来源:https://stackoverflow.com/questions/5720611/how-to-enable-mysql-strict-mode-globally-and-have-it-stay-on

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