Mysql didn't work

Hi, I’m not able to make mysql working … I try on 2 port : 3306 and 8899 (i’m using mamp)

on 8899:

18:43:16.027 [ERROR] [.p.m.i.MysqlPersistenceService:461 ] - mySQL: Failed connecting to the SQL database using: driverClass=com.mysql.jdbc.Driver, url=jdbc:mysql://localhost:8899/openhab, user=openhab, password=openhab

on 3306:

18:50:55.175 [ERROR] [.p.m.i.MysqlPersistenceService:461 ] - mySQL: Failed connecting to the SQL database using: driverClass=com.mysql.jdbc.Driver, url=jdbc:mysql://localhost:3306/openhab, user=openhab, password=openhab
java.sql.SQLException: Access denied for user ‘openhab’@‘localhost’ (using password: YES)

.cfg:

mysql:url=jdbc:mysql://localhost:3306/openhab
mysql:user=openhab
mysql:password=openhab
mysql:reconnectCnt=1

mysql.persist:

Strategies {
default = everyChange
}

items {
* : strategy = default, restoreOnStartup
}

p.s i’m able to log with openhab from command line…

Thank you for your help i’m on this issue since 2-3 day !

Hi

Have you created the database openhab and created the user openhab with passwd openhab in mysql.

You must also give user openhab full access to openhab database.

/Mike

1 Like

i did that :

CREATE USER ‘openhab’@‘localhost’ IDENTIFIED BY ‘openhab’;
GRANT ALL PRIVILEGES ON openhab.* TO ‘openhab’@‘localhost’;

EDIT

Wow … I try with root user …

> database using: driverClass=com.mysql.jdbc.Driver, url=jdbc:mysql://localhost:3306/openhab, user=root, password=root
> java.sql.SQLException: Access denied for user ‘root’@‘localhost’ (using password: YES)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078) ~[mysql-connector-java-5.1.26-bin.jar:na]
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4190) ~[mysql-connector-java-5.1.26-bin.jar:na]
I know it’s the good password ( i change it for something simple to make a test… )

EDIT

Ok i resolve it ! i had another mysql server on my computer and the good one was not allowed on the network so openhab try to connect to the other…

God damn mac who have to many build-in server ! i had similar issue with openhab

EDIT

One last thing … well i hope ! Ehhh … in my log everything seems working great but no trace of something is save in the db … why ? Does-it need another config to tell what to put in a db ? i taught it was the job of the .persistent file