Hello,
I have this script where I'm used to doing a simple projection for a dynamic result but something goes wrong ; as i have this error :
1055 - Expression #5 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'mutuelle_bi.M.etat_bs' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
How may i modify my script, by the way, to solve this problem , given that I shouldn't modify any config file of my sql server . and i should only write scripts
Any Suggestions to fix this issue asap??
MySQL error : sql_mode=only_full_group_by
Moderator: Staff
-
- Posts: 0
- Joined: Wed Sep 28, 2016 10:50 am
cPanel Server Management
@ 30$ Onwards
@ 30$ Onwards
Re: MySQL error : sql_mode=only_full_group_by
Hello,
You can try to disable the only_full_group_by setting in the MySQL configuration
Go to MySQL prompt and use the command listed below.
If you want to set these modes permanently then you need to edit your MySQL conf like below.
Scroll to the bottom of file and press 'i' to enter insert mode
Copy and paste
esc to exit input mode
:wq to save and close vi editor.
sudo service mysql restart to restart MySQL.
Done!
You can try to disable the only_full_group_by setting in the MySQL configuration
Go to MySQL prompt and use the command listed below.
Code: Select all
set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
Code: Select all
sudo vi /etc/mysql/my.cnf
Copy and paste
Code: Select all
[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 to the bottom of the file
:wq to save and close vi editor.
sudo service mysql restart to restart MySQL.
Done!
Aaron N
Linux Support Engineer.
Nixtree Solutions LLP
Managed Full Server Backups
https://www.nixtree.com/managed-backups.php
Follow us on : https://twitter.com/nixtree
Linux Support Engineer.
Nixtree Solutions LLP
Managed Full Server Backups
https://www.nixtree.com/managed-backups.php
Follow us on : https://twitter.com/nixtree