2

以下に示すように、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 を確認しましたが違いはありません。ここで何が間違っていますか?

4

1 に答える 1

1

最初の編集my.cnf(ubuntu)またはmy.ini(Windows)

Ubuntu の場合:sudo gedit /etc/mysql/my.cnf


設定を変更し、保存して閉じます。


mysql を再起動します。sudo service mysql restart すべての変更が保存されます。


次に、もう一度確認します。


mysql> SELECT @@GLOBAL.sql_mode;
于 2016-10-21T12:56:28.140 に答える