USB HID Logger

Trust In Confidence!

For Windows 2000 - Windows 10 (2016) (incl. Server, x86 and x64). Latest version: 1.7.2 build 205. .


USB HID to MySQL: Writing HID report values to MySQL database

Configuring how to write USB HID data to a MySQL database is very much similar to configuring how to write data to MSSQL. Only main differences are described in this manual.

1. Download and install the 32-bit version of MySQL ODBC Connector (the ODBC driver) for MySQL from mysql.org.

usb-hid-to-mysql1

Fig. 1 Driver section

2. The structure of a table in the database will look like this:

2.1 In case of writing a lot of USB HID items

 
CREATE TABLE `usb_data` (
 `REC_ID` int(11) NOT NULL AUTO_INCREMENT,
 `TIMESTAMP` datetime DEFAULT NULL,
 `ITEM_NAME` varchar(25) NOT NULL,
 `ITEM_VALUE` varchar(255) DEFAULT NULL,
PRIMARY KEY (`REC_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

2.2 In case of writing several USB HID items

CREATE TABLE `usb_data_2` (
  `REC_ID` int(11) NOT NULL AUTO_INCREMENT,
  `TIMESTAMP` datetime NOT NULL,
  `ITEM1` varchar(30) DEFAULT NULL,
  `ITEM2` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`REC_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

If you specify any other data type than String for ITEM1 or ITEM2 in the USB HID settings, you should create the columns of the corresponding types while creating a table.

3. Create an ODBC data source for your MySQL database.

4. During "Binding", you should take into account that the names of the table and its columns are case-sensitive in MySQL.

Related articles:

Writing HID report items to a database;
USB HID to MSSQL (writing a lot of HID report items);
USB HID to MS SQL (writing several HID report items to separate columns);
Writing HID report values to MySQL database;
USB to Excel: Writing HID report data to Excel in real time;

Read more about:

USB HID Logger