JDBC MySQL issue - only items table created

Platform information:

  • Hardware: Windows 7 64-bit
  • MYSQL version 8.0.21
  • Java Runtime Environment: V8
  • openHAB version: 2.5.8 stable

JDBC MySQL created table ‘items’ with no rows inside and nothing more. Following found in log:

2020-08-31 00:41:15.040 [INFO ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: Driver is available::Yank setupDataSource
2020-08-31 00:41:15.059 [WARN ] [.zaxxer.hikari.util.DriverDataSource] - Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.
2020-08-31 00:41:15.190 [INFO ] [persistence.jdbc.internal.JdbcMapper] - JDBC::logTime: ‘pingDB’:
afterAccess = 150 ms
timeAverage50 = 150 ms
timeAverage100 = 150 ms
timeAverage200 = 150 ms
afterAccessMin = 150 ms
afterAccessMax = 150 ms
1000Statements = 0 sec
statementCount = 1

2020-08-31 00:41:15.197 [INFO ] [persistence.jdbc.internal.JdbcMapper] - JDBC::logTime: ‘doCreateItemsTableIfNot’:
afterAccess = 5 ms
timeAverage50 = 77 ms
timeAverage100 = 77 ms
timeAverage200 = 77 ms
afterAccessMin = 5 ms
afterAccessMax = 150 ms
1000Statements = 0 sec
statementCount = 2

2020-08-31 00:41:15.207 [INFO ] [persistence.jdbc.internal.JdbcMapper] - JDBC::logTime: ‘getItemIDTableNames’:
afterAccess = 9 ms
timeAverage50 = 54 ms
timeAverage100 = 54 ms
timeAverage200 = 54 ms
afterAccessMin = 5 ms
afterAccessMax = 150 ms
1000Statements = 0 sec
statementCount = 3

You do not have the JDCB driver installed

2020-08-31 00:41:15.059 [WARN ] [.zaxxer.hikari.util.DriverDataSource] - Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.

Could You suggest - where to put mysql-connector-java-8.0.21.jar ?
In \addons directory ?

I’ve put in in addons and runtime/lib, but …

in log:
2020-08-31 12:40:29.272 [WARN ] [.zaxxer.hikari.util.DriverDataSource] - Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.

on console:
openhab> Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class is com.mysql.cj.jdbc.Driver’. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.

com.mysql.jdbc.Driver - not found, because code must use com.mysql.cj.jdbc.Driver… looks like is a bug ?

How about using Paper UI

  • Add ons
    Persistence
    JDBC Persistence MySQL

Install

Thanx.

Items { *: … } must be created to get it create tabled per item.

Very thanx.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.