Page 1 of 1
ShortQuery
Posted: Mon Jul 26, 2021 6:35 pm
by brick-william
I am trying to retrieve some data from database, but when I run https://api.opendental.com/api/v1/queries/ShortQuery (PUT), I get an error that "An SQL error occured: Authentication to host 'localhost' for user '' using method 'mysql_native_password' failed with message: Access denied for user ''@'localhost' to database 'demo'"
The body of the api is:
{
"SqlCommand": "SELECT LName FROM provider WHERE ProvNum = 1"
}
this is a simple query that I use to test whether I can run query using the ShortQuery api or not. Any help would be appreciated.
thanks
Re: ShortQuery
Posted: Tue Jul 27, 2021 8:59 am
by SLeon
The ShortQuery method will use the ''@localhost MySql user for your database by default, unless you have specifically set up a different UserLow (which is rare). This ''@localhost user has no permissions granted by default, so you just need to grant that MySql user SELECT privileges to be able to run your query.
Re: ShortQuery
Posted: Tue Jul 27, 2021 10:57 am
by brick-william
thank you SLeon, it works.

Re: ShortQuery
Posted: Thu Jul 29, 2021 7:15 pm
by jordansparks
Hmm. This doesn't seem right. Didn't we change that to use the normal MySQL user? I'm on vacation for a week, but I didn't want to forget to circle back around to this. In other words, the ShortQuery should work out of the box without any additional setup.
Re: ShortQuery
Posted: Fri Sep 03, 2021 9:03 am
by mandmdiet
We did have to grant @localhost read access as well to get the API to work for ShortQuery. Is this something that you think is being changed JordanSparks? We need to include it in our evaluation of which integration options to use with Open Dental if we need to set this configuration on all of the our client's machines.
Re: ShortQuery
Posted: Mon Sep 06, 2021 5:54 pm
by jordansparks
I think it's already fixed, but if not, I would consider it a bug and we will fix it. No changes to MySQL users should be required.