Question

Remove only_full_group_by from sql mode

Posted April 7, 2020 594 views
MySQL

Hello.
I’m trying to remove onlyfullgroupby from sql mode but in the MySQL droplet settings UI
there is no only
fullgroupby to remove.

Although when I connect to the DB from command line and I run command
SELECT @@sql_mode;

which outputs

REALASFLOAT,PIPESASCONCAT,ANSIQUOTES,IGNORESPACE,ONLYFULLGROUPBY,NOZEROINDATE,NOZERODATE,ERRORFORDIVISIONBYZERO,NOENGINESUBSTITUTION

Which HAS the onlyfullgroup_by !
Any ideas?

1 comment

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi @kwstasna3 @MariusJP,

I assume your question is about MySQL managed database; With MySQL managed database you ​should now be able to set the global SQL mode for MySQL Cluster.

You can set the SQL mode by finding the cluster on the Databases page -> click the cluster’s name -> Settings tab - > Global SQL mode -> Edit button -> from the drop-down menu select the SQL mode you want to modify

Save to persist the change or cancel to revert.

The link provides more information on how to set global SQL mode on MySQL clusters.

https://docs.digitalocean.com/products/databases/mysql/how-to/set-sql-mode/

Once you have edited the global SQL mode from the cloud control panel run the below command to check the current global SQL mode.

SELECT @@GLOBAL.sql_mode;

If you are executing SELECT @@sql_mode; this will only show session-level sql_mode which tends to change when you log out of MySQL managed database and log in back.

I hope this helps!

Regards,
Rajkishore