Report this

What is the reason for this report?

Are MySQL comments allowed on Databases hosted by Digital Ocean?

Posted on July 27, 2020

I receive this exception anytime when trying to add a comment on a database column or table:

add column label_data mediumtext NULL DEFAULT NULL COMMENT 'Shipping labels file encoded in base64' to table {{%orders}} ...Exception: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COMMENT 'Shipping labels file encoded in base64'' at line 1

It this because of a user permission issue on the hosted MySQL?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Hi @cgsmith,

MySQL comments are allowed on MySQL managed database, The error is due to a syntax error and it is not a permission issue; you can run below alter SQL statement to add column label_data with COMMENT.

alter table test add column label_data mediumtext NULL DEFAULT NULL COMMENT 'Shipping labels file encoded in base64';

I hope this helps!

Regards, Rajkishore

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.