mysql Ver 14.14 Distrib 5.7.15, for Linux (x86_64) using EditLine wrapper
I'm trying to configure my MYSQL instance to turn off some of the stricter settings currently I've done this:
mysql> select @@GLOBAL.sql_mode;
+-------------------------------------------------------------------------------------------------------------------------------------------+
| @@GLOBAL.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 |
sudo vi /etc/mysql/mysql.cnf
[mysqld]
sql-mode=""
mysqld restart. Then try to see what the global SQL mode is:
mysql> select @@GLOBAL.sql_mode;
+-------------------------------------------------------------------------------------------------------------------------------------------+
| @@GLOBAL.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 |
Anyone any ideas on what to try next. Can't seem to get this setting to stick permanently and can't see any other files to try.
Edit:
locate returns:
/etc/alternatives/my.cnf
/etc/mysql/my.cnf
/etc/mysql/my.cnf.fallback
/var/lib/dpkg/alternatives/my.cnf
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf
Best Answer
On
Aug 05, 2015
, I answered the post Set sql_mode “blank” after upgrading to MySQL 5.6In my answer, I explained how Oracle created an additional
my.cnf
called/usr/my/cnf
.It has this (keep in mind this is MySQL 5.6 I am answering back then)
I guess some developer just gave up putting it in the code and slapped up a configure file as some demented shortcut.
If you have such a file, please comment out the last line and restart mysqld.
MySQL 5.7's default value for
sql_mode
is as mentionedUPDATE 2017-04-27 17:23 EDT
I just ran
mysqld --help --verbose | head -13
and got thisPlease run
mysqld --help --verbose 2>/dev/null | head -13 | tail -1
Check every file mentioned
UPDATE 2017-04-29 19:03 EDT
The
/usr/my.cnf
trick I mentioned in Set sql_mode “blank” after upgrading to MySQL 5.6 comes from a post written by Morgan Tocker under the heading "Changes in MySQL 5.6". This bait-and-switch method for sql_mode may not apply in this case since this is MySQL 5.7.As I mentioned in my earlier comment, I have successfully sql_mode by adding this to
/etc/my.cnf
You should not have to restart mysqld. You login to mysql and run
This will set incoming connections to a blank sql_mode
This will not change the sql_mode of currently established connections.
Restarting mysqld will guarantee the all incoming connections will have it blank.
If you cannot restart mysqld, you must restart your app/web servers and make them disconnect. Then,m restart your app/web servers to establish connections.
Please try this and let us the results.