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.
JGCODE
1/6
Local & Remote Connection to MySQL from LabVIEW (Windows)
Under User DSN Tab select Configure
Configure the database with the following settings.
If the server is located on this computer leave blank or enter localhost.
• Give the Data Source a name. This is the name you will connect to it from LabVIEW.
• Enter a description.
•
• 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.
JGCODE
2/6
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.
JGCODE
3/6
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.
JGCODE
4/6
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).
JGCODE
5/6
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/
JGCODE
6/6