LabVIEW Connection MySQL Database
Because of the project needs, the MySQL database is needed in LabVIEW development. Here are two ways to connect to the MySQL database.
Use the Labsql kit and the Database Connectivity Toolkit toolkit, respectively
Here are the steps to proceed:
1. Install MySQL Database
According to the requirements can go to the official to download the corresponding version, the version used here: Mysql-installer-community-5.7.14.0.msi
Install MYSQL-CONNECTOR-ODBC during the installation process, it is recommended that you install the X86 version, such as 1.
Note: If you follow the X64 bit, there will be an error in using LabVIEW to connect to MySQL
The error is :"The architecture does not match between the driver and the application in the specified DSN"
Figure 1 Installing the MySQL database
2. Create a data source (ODBC)
after installation, in the Control Panel-Administrative Tools-Data source (ODBC), there are 32-bit data sources and 64-bit data sources, select 32-bit data source management program, 2, as shown in the driver, you can see MySQL driver is the MySQL ODBC 5.3 ANSI Driver.
Figure 2 MySQL Driver
In "User DSN", click "Add", "Create new Data Source" appears, find "MySQL ODBC 5.3 ANSI Driver" drive, click "Done", 3 shown.
Figure 3 Adding create a new data source
In the "complete" pop-up "MySQL connector/odbc" data source Configuration "is filled in, create the DataSource name, the recommendation and the database name are consistent. Fill in the User and password and select the appropriate data name. Click "Test" to successfully connect, click "OK" button. This completes the creation of the new data source. As shown in 4.
4 MySQL connector/odbc "Data Source Configuration
3. Install Labsql Kit
: HTTP://PAN.BAIDU.COM/S/1MIJAGP6
The Downloaded Labsql Toolkit is extracted to the "national Instruments\labview 2014\user.lib" User.lib file under the LabVIEW installation directory. New Start LabVIEW
Software, which can be seen in the "Programs panel--User library", shown in 5.
Figure 5 Labsql Toolkit
4. Connect MySQL database--test database in LabVIEW
In the "program panel" select the Labsql control to create a database connection, 6, in the figure, three connections to the database can be, it is recommended to use the 3rd.
Figure 6 Connecting the database
5. Use the Database Connectivity Toolkit toolkit to manipulate MySQL databases, as shown in 7
Figure 7
Last note: There is no difference between using the LABSQL Toolkit and the Database Connectivity Toolkit toolkit to connect MySQL data. ODBC data source connections are used.
LabVIEW Connection MySQL Database