Disable ONLY_FULL_GROUP_BY at once

Asked

Viewed 893 times

0

How do I disable ONLY_FULL_GROUP_BY it remains disabled for good? I wonder why I already did the steps below:

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

and also direct from phpmyadmin:

  • I selected the localhost;
  • I clicked on Variables;
  • I went in SQL Modes;
  • I removed ONLY_FULL_GROUP_BY;

The problem is that every time I restart the note, it becomes active again.

2 answers

2


Good afternoon, on your terminal run the following command.

SHOW GLOBAL VARIABLES LIKE '%sql_mode%';

copy the content, except ONLY_FULL_GROUP_BY.

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

sql_mode=[conteudo_copiado]

Restart the service of MySQL and there, it’ll be standard.

  • Hello arllondias. Right. I searched the archive my.ini and I couldn’t find it. The only Mysql reference I could find was in /etc/mysql/ and the file I found next to what you mentioned was my.cnf. Is that it? If it’s not that file, where can I find the my.ini?

  • That, sorry, misspelled there, edited the answer

  • Thanks arllondias.

  • Not at all, @Fox.11

0

Just to reinforce the Arllondias response, in my case I had to put this 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"

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.