Question

Managed Database (MySQL) Characters query

Posted March 3, 2021 306 views
MySQLDatabasesDigitalOcean Managed MySQL Database

Hey guys,
we have currently an issue on a software which is connected against DO managed databases (MySQL).
We campe up to the result, that the issue is in the command quotes.

As an example, is NOT working:
SELECT * FROM someting_config where language_id = “2”

IS working
SELECT * FROM someting_config where language_id = 2
(see the “ in the id part.)

Before we are switching to managed database on DO we run this services on a own MySQL instance on a single server on DO. So looks like the managed database cluster can’t handle this.

Is there a way to change this setting? Can’t find anything regarding to it but maybe in the SQL Modes. Currently active:

  • ANSI_QUOTES
  • ERRORFORDIVISIONBYZERO
  • IGNORE_SPACE
  • NOENGINESUBSTITUTION
  • NOZERODATE
  • NOZEROIN_DATE
  • ONLYFULLGROUP_BY
  • PIPESASCONCAT
  • REALASFLOAT
  • STRICTALLTABLES

Thanks a lot!
Best,
Michael

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
3 answers

Does no one have any ideas?

Show answer This answer has been marked as resolved by goetzm.

Hi @goetzm,

We have updated regarding sql_mode functionality. 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://www.digitalocean.com/docs/databases/mysql/how-to/set-sql-mode/

Note: The ANSI (shorthand) label is a grouping of the below SQL mode setting. To explicitly update any of them, you will need to have ANSI enabled/select the ANSI(shorthand) label which removes it from the options, and then select any of the SQL Mode from the below

ANSIQUOTES,
IGNORE
SPACE,
ONLYFULLGROUPBY,
PIPE
ASCONCAT,
REAL
AS_FLOAT

Regards,
Rajkishore