Hi
I’m trying to get persistence to work with my newly created openhab2 binding. I have tried to follow this tutorial someone else had made. --> openHAB2 & MySQL persistence setup
So I did what it told me to do but still are not receiving any data in the table.
Have installed mysql on my own computer and connected to the server where the mysql openhab is installed. Here I see the table Items but no data in it when doing a select * from Items.
My “mysql.persist” file
// persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies {
// if no strategy is specified for an item entry below, the default list will be used
everyMinute : "0 * * * * ?"
every5Minutes : "0 */5 * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
default = everyChange
}
/*
* Each line in this section defines for which item(s) which strategy(ies) should be applied.
* You can list single items, use "*" for all items or "groupitem*" for all members of a group
* item (excl. the group item itself).
*/
Items {
// persist all items once a day and on every change and restore them from the db at startup
* : strategy = everyChange, everyDay, restoreOnStartup
My “mysql.cfg”
# the database url like 'jdbc:mysql://<host>:<port>/<database>' (without quotes)
url=jdbc:mysql://127.0.0.1:3306/OpenHAB2
# the database user
user=openhab2
# the database password
password="my password"
# the reconnection counter
#reconnectCnt=
# the connection timeout (in seconds)
#waitTimeout=
# Use MySQL Server time to store item values (=false) or use openHAB Server time (=true).
# For new installations, its recommend to set "localtime=true".
# (optional, defaults to false)
#localtime=true
And yes the mysql server is installed on the same linux server as openhab2.
And yes I have tried restarting the openhab2 service.
Hope someone can help