MySQL:永久设置sql_mode [英] MySQL: Setting sql_mode permanently

查看:105
本文介绍了MySQL:永久设置sql_mode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过MySQL命令行客户端,我试图设置全局mysql_mode:

Via the MySQL command line client, I am trying to set the global mysql_mode:

SET GLOBAL sql_mode = TRADITIONAL;

这适用于当前会话,但是在我重新启动服务器之后,sql_mode返回其默认值:",这是一个空字符串.

This works for the current session, but after I restart the server, the sql_mode goes back to its default: '', an empty string.

如何将sql_mode永久设置为TRADITIONAL?

How can I permanently set sql_mode to TRADITIONAL?

如果相关,MySQL是WAMP软件包的一部分.

If relevant, the MySQL is part of the WAMP package.

谢谢.

推荐答案

将此添加到my.cnf文件(如果使用Windows,则添加到my.ini):

Add this to your my.cnf file (or my.ini if you're using windows):

sql_mode="TRADITIONAL"

然后重新启动服务器

这篇关于MySQL:永久设置sql_mode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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