Disable ONLY_FULL_GROUP_BY for once

0

How do I disable it ONLY_FULL_GROUP_BY for once? I ask why I have already done the steps below:

SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

and also direct from phpmyadmin :

  • I selected localhost;
  • I clicked Variables;
  • I've been in SQL Modes;
  • Removed ONLY_FULL_GROUP_BY;

The problem is that every time I restart the note, it resumes.

    
asked by anonymous 20.04.2018 / 16:30

2 answers

2

Good afternoon, on your terminal run the following command.

SHOW GLOBAL VARIABLES LIKE '%sql_mode%' ;

copy content, except ONLY_FULL_GROUP_BY .

Once this is done, look for the configuration file of MySQL which is my.cnf , add the following line to the file:

sql_mode=[conteudo_copiado]

Restart the MySQL service and you're done, it will default.

    
23.04.2018 / 21:40
0

Just to reinforce the response of the arllondias, in my case I had to put that way in the file my.cnf:

[mysqld]
sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

Note that I put [mysqld] and also within quotation marks the new value of sql_mode. After that, restart mysql: service mysql restart

    
28.05.2018 / 13:57