Openfire doesn't work

Hi,I has compiled the source code of openfire,then I try to run it.But I get an exception as follow:

Database setup or configuration error: Please verify your database settings and check the logs/error.log file for detailed error messages.

java.lang.IllegalArgumentException: java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 retries. The exception from the last attempt is as follows: java.sql.SQLException: Access denied for user ‘root’@‘localhost’ (using password: YES)

at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:720)

at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:427)

at org.jivesoftware.openfire.XMPPServer.(XMPPServer.java:161)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(Unknown Source)

at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:108)

at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:52)

Caused by: java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 retries. The exception from the last attempt is as follows: java.sql.SQLException: Access denied for user ‘root’@‘localhost’ (using password: YES)

at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager .java:124)

at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:708)

… 10 more

How can I fix this?