如何修复未知变量"sql-mode = ANSI"? [英] How to fix `unknown variable 'sql-mode=ANSI'`?
本文介绍了如何修复未知变量"sql-mode = ANSI"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用MySQL 5.5.27,在my.cnf中,我有:
Using MySQL 5.5.27, in my.cnf I have:
[mysql]
sql_mode=ANSI
启动mysql控制台后,我得到:
Upon starting the mysql console I get:
unknown variable 'sql-mode=TRADITIONAL'
MySQL文档服务器SQL模式显示该选项,那么为什么它不起作用?
The MySQL doc Server SQL Modes shows that option, so why does it not work?
(如果有帮助,我在OSX Lion上)
(If it helps, I am on OSX Lion)
此外,这是一个粘贴框,显示了别人尝试过的事情,没有解决办法.
推荐答案
我可以肯定它不起作用的原因是因为它是mysqld的参数,而不是客户端的参数.我想出了一种替代方法,您可以改为执行此操作.将您的用户my.cnf i.e. ~/.my.cnf
修改为以下格式:
I'm pretty certain the reason it isn't working is because it is an argument for mysqld and not the client. I came up with an alternative way that you could do this instead. Edit your users my.cnf i.e. ~/.my.cnf
to be something like this:
[client]
init-command="set sql_mode='TRADITIONAL'"
这篇关于如何修复未知变量"sql-mode = ANSI"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文