LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview and MySQL database

Hi ,
I need to know how to acess remote server of mySQL  database with  LabVIEW ?

I have already tested the connexion between mySQL data base ( using XAMPP ) and LabVIEW in local computer and it's done successfully .

My problem now is how o connect to remote server of MySQL database from LabVIEW to read and insert data .

I have created the database in a free webhosting (  000webhost.com  )  ...

thank you in advance ! 

0 Kudos
Message 1 of 8
(7,049 Views)
It sounds like the database is driving a website. That being said, accessing it directly over the network will likely not be possible to to security issues.

You will need to use the http client VIs and let the webserver/php engine mediate your database io. You will need to create php pages that interact with the database. You also need to work out how to format the data you're transferring back and forth. JSON works well.

How much do you know about web development?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 8
(7,023 Views)

First , thanks very much for answering me . So , I know about php development but don't know JSON . Let me tell you more about my project which have two parts :
Part 1 : I have do sent / recieve data from the work station using arduino board ( via ethernet shield ) to remote database ( which is in the net ) .

Part 2 : I have to develope LabView interface in which  i well recieve data from the remote database ( which is in the net ) for supervision and some analysis... 

So , I started to test the connexion between Labview and MySQL database in my local machine ( localhost ) via ODBC and MySQL connector and it works fine . 

When I start to do it with the remote database then I've been blocked it don't work ( i putted the server ip of my webhost account and the remote database name ...) but it don't work at all ...

 

Now  I hope you understand my problem more than before and i hope you can give me solution or some ideas to try . 
THANKS in advance .

0 Kudos
Message 3 of 8
(7,000 Views)
What you're describing is just what I would expect. For security reasons, direct access to the database is blocked by the web server. As I said, you will need to access the database through the webserver. You will need to create a php script that queries the database and returns the data you want. You then use the LabVIEW http client VIs to access that script.

JSON is just a way of encoding data. Check Google for a description. Its very easy and there are low-level LabVIEW functions that can convert json directly into LabVIEW data structures like arrays and clusters.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 8
(6,985 Views)

Is that the only solution ? i found this PDF which have steps for setting up connection between local and remote MySQL database and LabVIEW , I checked the steps and followed them but no results , whould you please check it for me , if it can be successful it well save me  because i think that your solution is really hard to do . 

 

THANKS for help .

0 Kudos
Message 5 of 8
(6,976 Views)
It's not really that hard, and the database being secured it is the only way.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 8
(6,961 Views)

If you use your own database/web server (e.g. a dedicated/virtual server) or with some web hosts (usually paid ones...) you can configure the database to allow external connections. You'll need to contact your web host to see if it is possible to configure the database to allow external connections.

 

If that isn't possible, like mike has said - you will need to create a script on the web server that can respond to requests from your LabVIEW application with data from the database.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 7 of 8
(6,910 Views)

Hi Bilel,


can you give me your e-mail adress ? i need your help 

thanks.

0 Kudos
Message 8 of 8
(6,432 Views)