Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
972 views
in Technique[技术] by (71.8m points)

centos7 - sql_mode has no effect in my.cnf (CentOS 7 / MySQL 5.7.32)

I'm running mysql 5.7.32 on CentOS 7 and I try to configure sql_mode in /etc/my.cnf as follow :

sql_mode=""

But it has no effect after restarting mysqld :

mysql> SELECT @@GLOBAL.sql_mode global, @@SESSION.sql_mode session;
+-------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| global                                                                                                                                    | session                                                                                                                                   |
+-------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| 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 | 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 |
+-------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+

No effect either if I only set one value :

sql_mode="NO_AUTO_CREATE_USER"

I tried everything, sql-mode, simple quotes, double quotes, no quotes at all, no sql_mode. There is no other conf file like /usr/my.cnf on the system...

Thank you for your help if you know what to do

question from:https://stackoverflow.com/questions/65923688/sql-mode-has-no-effect-in-my-cnf-centos-7-mysql-5-7-32

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...