6

How to disable mysql strict mode in Sequel Pro on Mac? I got this error sql_mode = only_full_group_by. Been trying to find the solution, but nothing helps.

msanford
  • 11,803
  • 11
  • 66
  • 93
Syamim Hazmi
  • 81
  • 2
  • 7

2 Answers2

16

You might get an error referring to only_full_group_by when you're running MySQL 5.6-compatible SQL code on a MySQL 5.7 database.

To temporarily make the MySQL 5.7 database behave like a MySQL 5.6 database, you will have to run this query first:

SET SESSION sql_mode="NO_ENGINE_SUBSTITUTION";

enter image description here

This works in Sequel Pro, Sequel Ace, and other database managers.

Pepijn Olivier
  • 927
  • 1
  • 18
  • 32
  • that worked! But what is the long term solution? How should code be edited to avoid the problem? – Jeremy Young Dec 11 '18 at 17:09
  • @JeremyYoung Depends :) You can choose to stay on MySQL 5.6. You can also [persist this setting globally](https://stackoverflow.com/q/2317650/237739). Or you have to rewrite your queries. [More info](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_only_full_group_by) – Pepijn Olivier Dec 15 '18 at 00:41
2

If you are using Laravel,

open config/database.php

Under connections.php,

change

'strict' => false // was true

then run $ php artisan config:clear

Dazzle
  • 2,880
  • 3
  • 25
  • 52