Method 1:
Remove ONLY_FULL_GROUP_BY from MySQL console
mysql >SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
-----------------------------------------------------------------Method 2: (ubuntu commands)
- sudo nano /etc/mysql/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"
- sudo service mysql restart to restart MySQL
This will disableONLY_FULL_GROUP_BY
for ALL users
-----------------------------------------------------------------
Method 3: (Easy)
- Log into your server as root
- Get script wget https://gist.githubusercontent.com/nfourtythree/90fb8ef5eeafdf478f522720314c60bd/raw/disable-strict-mode.sh
- Make is executable chmod +x disable-strict-mode.sh
- Run the script ./disable-strict-mode.sh
- DONE!
You can keep the script where you downloaded it for future mods or references or you can rm -rf disable-strict-mode.sh and delete the shell script.
You will then have MySQL 5.7 without strict mode.
DISCLAIMER: Not sure if it works with version 8.0