【问题标题】:Not able to set sql_mode to none无法将 sql_mode 设置为 none
【发布时间】:2016-01-25 09:57:20
【问题描述】:

我在 mac El Capitan 上使用如下所示的 5.7.9 版本。

~  mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.7.9 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SELECT @@sql_mode;
+-------------------------------------------------------+
| @@sql_mode                                                                                                                                |
+--------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+----------------------------------------+
1 row in set (0.00 sec)

我创建了一个文件 ~/.my.cnf 并添加了以下内容。

[mysqld]

sql_mode =''

我重新启动了mysql并再次检查了sql_mode,但没有任何区别。我在这里做错了什么?

【问题讨论】:

标签: mysql sql-mode


【解决方案1】:

首先编辑my.cnf(ubuntu)my.ini(Windows)

对于 ubuntu:sudo gedit /etc/mysql/my.cnf


更改您的设置,保存并关闭它。


重启mysql:sudo service mysql restart 将保存所有更改。


然后再检查:


mysql> SELECT @@GLOBAL.sql_mode;

【讨论】:

    猜你喜欢
    • 2019-12-18
    • 1970-01-01
    • 2021-01-11
    • 1970-01-01
    • 2013-12-20
    • 2021-08-17
    • 1970-01-01
    • 2020-12-20
    • 2020-05-22
    相关资源
    最近更新 更多