LabVIEW - Connect To MySQL
LabVIEW - Connect To MySQL
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
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
Note: You can configure a User DSN for a specific user or a System DSN for all users. 3/6 JGCODE
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
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
Links
6/6 JGCODE