JDBC:MYSQL "No connection to database."

Hey folks,

I’m having a strange issue with my persistence service for OH.
My setup:

  • OH 4.1.1 running on a D30 (mini pc) under linux
  • dockered mysql Ver 8.1.0 for Linux on aarch64 RPI3

I’ve installed the JDBC Persistence MySQL Add-On and set it up like this:
URL: jdbc:mysql://myMysqlIp:3306/OpenHAB?serverTimezone=Europe/Berlin
DB-User: ohUser
DB-Password: ohUser-Password

In my dockered MYSQL-Server I’ve created a DB “OpenHAB” and the user “ohUser” for Host “%” which has been granted all rigths on this DB.

I can connect to the mysql-server from any host (including the OH Host) in my network for ohUser with a mysql Client and create / delete / insert into tables as desired. Nevertheless i cant get my Persistence service running…

The OH-Log says:

2024-01-18 14:33:16.598 [DEBUG] [persistence.jdbc.internal.JdbcMapper] - JDBC::pingDB
2024-01-18 14:33:16.599 [DEBUG] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection isDriverAvailable: true
2024-01-18 14:33:16.604 [DEBUG] [persistence.jdbc.internal.JdbcMapper] - JDBC::checkDBAcessability, first try connection: true
2024-01-18 14:33:16.604 [WARN ] [jdbc.internal.JdbcPersistenceService] - JDBC::store: No connection to database. Cannot persist state ‘20 °C’ for item ‘EGWohnzimmerHZTreppe_ActualTemperature (Type=NumberItem, State=20 °C, Label=Aktuelle Temperatur, Category=Temperature, Tags=[Point], Groups=[EGWohnzimmerHZTreppe])’! Will retry connecting to database when error count:0 equals errReconnectThreshold:3

I’ve no clue whats wrong… The authentification OH → MYSQL works. If user or password missmatch i get a
JDBC::openConnection: failed to open connection: Failed to initialize pool: Access denied for user ‘openhabTEST’@‘ipOfOH’ (using password: YES)
Can’t be a network issue though…

Thanks in advance and cheers

EDIT: Did some more “debugging”:

  1. changed the user / pw for the JDBC-MySql OH-Addon to the DBs root-user to ensure it’s just a FU with my DBs privileges → still the same error in the log.
  2. created a table for the Item “TestButton” with the same name an insertet some values
    (Type=SwitchItem, State=ON, Label=TestButton, Category=switch) → still same error.
  3. created a mariaDB in container, added and configured the MariaDB OH-Addon accordingly → still excatly the same error.
1 Like

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