rednaxela
rednaxela

Reputation: 801

Sonar SQLException when starting tomcat

I have been trying to install a new version of Sonar, however after this did not work (due to a table_lock error with the database migration) I have referred back to the original version 2.11. Now when I start tomcat I get this exception (attached). I have been changing the my.cnf and some things may have been reset.

In the catalina.out log I get this error:

    ... 42 common frames omitted
Caused by: java.sql.SQLException: Access denied for user 'sonar'@'localhost' (using       password: YES)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1075) [mysql-connector-java-5.1.13.jar:na]
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566) [mysql-connector-java-5.1.13.jar:na]
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498) [mysql-connector-java-5.1.13.jar:na]
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:919) [mysql-connector-java-5.1.13.jar:na]
    at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4004) [mysql-connector-java-5.1.13.jar:na]

Upvotes: 0

Views: 136

Answers (1)

gareth_bowles
gareth_bowles

Reputation: 21150

Looks like your Sonar database no longer has access granted for the sonar user. To fix it, type "mysql" from a command prompt and do the following:

mysql> GRANT ALL ON your_sonar_database TO 'sonar@localhost' IDENTIFIED BY 'password_for_sonar_user';
mysql> FLUSH PRIVILEGES;
mysql> exit

Then restart the Sonar server and you should be good.

Upvotes: 1

Related Questions