LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Web Services MySQL User Permissions

Solved!
Go to solution

Hello, 

 

I'm stuck and not sure where to turn next.  I have a web service that is pretty straight forward.  All of the functionality works as expected, except for when I try to get it to do a MySQL query.

 

The function works locally, I can do the MySQL query just fine.  But when I call that same VI as a deployed web service, it no longer works.  It gives me an error saying it cannot connect.  More specifically it is this error:

Error -2147467259
ADO Error: 0x80004005
Exception occured in Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified in NI_Database_API.lvlib:DB Tools Open Connec (String).vi

 

I tried taking a look at the logged in username, and I can see that when running as a web service I get a "SYSTEM" user name rather than my own name.  Regardless of this, I'm using the same credentials to log into the MySQL server.  

 

This likely is not a LabVIEW problem per say, but to me it seems like maybe the "SYSTEM" users permissions that the Web service is accessing do not have permissions to access MySQL.  

Does anyone know what settings I need to change?  A LabVIEW Web Services setting?  A MySQL setting?  I really don't know and my Google searching isn't helping.


Thanks!

Shane

0 Kudos
Message 1 of 2
(944 Views)
Solution
Accepted by topic author Shane-C

I messed around with this a bit more and finally discovered the answer.  Perhaps obvious to someone who knows more about webpages, but I'm still pretty new to this particular area.

 

Apparently when you create a ODBC connector for your database, the "User DSN" is not the same as the "System DSN".  I had only made a User DSN and so I could connect to the database just fine when doing so locally, but when making the same attempt remotely as a web page it was throwing an error of permissions.  I made a System DSN to also work with the database and now I'm up and running.

 

Just figured I'd answer my own question here for anyone else who may run into this.

0 Kudos
Message 2 of 2
(873 Views)