Local & Remote Connection to MySQL from LabVIEW (Windows)
Local Connection Install mySQL Community Server (download from http://dev.mysql.com/downloads/mysql/). Install windows ODBC drivers (download from http://dev.mysql.com/downloads/connector/odbc/). Install the LabVIEW Database and Connectivity Toolkit
Open the Data Sources (ODBC) Administrator under Control Panel>>All Control Panel Items>>Administrative Tools.
Open the Drivers Tab and ensure the MySQL ODBC drivers are installed.
1/6 JGCODE
Local & Remote Connection to MySQL from LabVIEW (Windows)
Under User DSN Tab select Configure
Configure the database with the following settings. Give the Data Source a name. This is the name you will connect to it from LabVIEW. Enter a description. If the server is located on this computer leave blank or enter localhost. The default port is 3306. The default user name is root. The default password is blank.
The Database drop down list will populate with available database for that Username and Password. Select a database and press select to test the connection.
Note: You do not need to configure the Username and Password as you can pass these parameters into LabVIEW. However, you will not be able to see the databases on the server if you do not enter them.
2/6 JGCODE
Local & Remote Connection to MySQL from LabVIEW (Windows)
The database will appear in the User Data Sources list.
Note: You can configure a User DSN for a specific user or a System DSN for all users. 3/6 JGCODE
Local & Remote Connection to MySQL from LabVIEW (Windows)
The database can now be called from LabVIEW using the Database Connectivity Toolkit using the Data Source Name as Connection Information string input.
4/6 JGCODE
Local & Remote Connection to MySQL from LabVIEW (Windows)
Remote Connection
Connect to a remote database by supplying the server IP address. Ensure the selected port is allowed by the firewall (the default is blocked). Use LabVIEW is the same way (username and password optional).
5/6 JGCODE
Local & Remote Connection to MySQL from LabVIEW (Windows)
Links
Configuring a Connector/ODBC DSN on Windows http://dev.mysql.com/doc/refman/5.0/en/connector-odbc-configuration-dsn-windows.html
Using MySQL with the Database Connectivity Toolkit on Windows http://digital.ni.com/public.nsf/allkb/47A8CF66D5E3C8CC8625720A006139D6
Setting up a Database through ODBC http://zone.ni.com/devzone/cda/tut/p/id/4855
LabVIEW Database Connectivity Toolkit Help http://www.ni.com/pdf/manuals/371525a.pdf
LabVIEW Database Known Issues http://zone.ni.com/reference/en-XX/help/370052F-01/tssuppref/database_known_issues/
6/6 JGCODE