0

After updating to MySQL 8.0.32 under Windows 10 I would like to permanently switch off ONLY_FULL_GROUP_BY in "sql_mode". SET GLOBAL sql_mode='...' is not permanent and the default setting, which includes ONLY_FULL_GROUP_BY, is reestablished after every service shutdown/restart.
So I looked for the config file. Executing >mysqladmin I read

Default options are read from the following files in the given order:
C:\WINDOWS\my.ini C:\WINDOWS\my.cnf C:\my.ini C:\my.cnf C:\Program Files\MySQL\MySQL Server 8.0\my.ini C:\Program Files\MySQL\MySQL Server 8.0\my.cnf,

but none of these files exists in my system. So I created the file C:\Program Files\MySQL\MySQL Server 8.0\my.cnf with the following contents:

[mysqld]

sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"

but after restarting the service a SELECT @@GLOBAL.sql_mode; included ONLY_FULL_GROUP_BY as usual.

I renamed my.cnf to my.ini and used other directories for the file, then I replaced in the file [mysqld] by [client] or sql_mode by sql-mode as suggested here but to no avail.

Ken White
  • 123,280
  • 14
  • 225
  • 444
Jörg
  • 214
  • 1
  • 9

1 Answers1

0

Modifying the definition of sql-mode in %PROGRAMDATA%\MySQL\MySQL Server 8.0\my.ini did the job.

Jörg
  • 214
  • 1
  • 9