By PSNick
Hello,
I am using OpenLiteSpeed WordPress 1-Click from the marketplace and a Managed MySQL 8 Database.
There’s a specific and well known plugin I need to run the website: Easy Digital Downloads. On a fresh install, with only that plugin active I am getting a database error:
WordPress database error: [Unknown column 'edd_payment_note' in 'where clause']
SELECT comment_approved, COUNT( * ) AS num_comments FROM wp_comments WHERE comment_type != "edd_payment_note" GROUP BY comment_approved
The error seems present only with the Managed DB. Using the provided MariaDB 10.4 from the droplet the plugin works just fine.
The Global SQL mode has the default settings:
ANSI_QUOTES
ERROR_FOR_DIVISION_BY_ZERO
IGNORE_SPACE
NO_ENGINE_SUBSTITUTION
NO_ZERO_DATE
NO_ZERO_IN_DATE
ONLY_FULL_GROUP_BY
PIPES_AS_CONCAT
REAL_AS_FLOAT
STRICT_ALL_TABLES
What could be the difference between the databases that’s causing that issue? and how may I be able to fix it?
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!
The error that you are receiving is that the specific column edd_payment_note that you are requesting isn’t found in the DB/table that you are requesting it from.
You would need to login to your Managed DB and confirm that you have the correct database there, that it has the correct tables, and the correct fields.
There aren’t any differences between the two, but perhaps there was a part of a setup that was missed which is why a field or table maybe missing between the two.
You can use the describe function in MySQL to show what columns are in a database.
MYSQL> use database_name;
MYSQL> describe table_name;
Do that on both servers and compare them to ensure that they match.
I had the same issue with a new Digital Ocean Managed DB. The issue was with the ANSI_QUOTES sql_mode which means that double quotation marks are interpreted as identifier quotes (like `) instead of string quotes. I was able to switch this mode off from the Digital Ocean control panel under “Settings” for the database cluster and then my queries worked again. Or you can change it from the MySQL command line as per here:
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.