Unable to access Sonar MySQL database Caused by: java.sql.SQLException: Access denied for user 'sonar'@'glassfishdev.ccs.local' (using password: YES) Unable to access Sonar MySQL database Caused by: java.sql.SQLException: Access denied for user 'sonar'@'glassfishdev.ccs.local' (using password: YES) jenkins jenkins

Unable to access Sonar MySQL database Caused by: java.sql.SQLException: Access denied for user 'sonar'@'glassfishdev.ccs.local' (using password: YES)


The solution was to run the following command:

GRANT ALL ON *.* TO 'sonar'@'%';


The right solution is this:

GRANT ALL PRIVILEGES ON `sonar`.* TO 'sonar'@'localhost';

As explained here, connections to localhost occur over a UNIX domain socket. You are likely logging in as an anonymous user to localhost (e.g. ''@localhost).


I just tried it with sonar 4.5.2 with grants only on sonar.* and its definitely not working.

It looks like sonarqube requires additionnal privileges to work, personnaly i haven't identified which ones yet, and i'm still using a grant all on the database.