Could not create connection to database server. Attempted reconnect 3 times. Giving up.

做查詢時沒有數據出來,後臺報錯

報錯信息:

org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection

Caused by: java.sql.SQLException: Cannot create PoolableConnectionFactory (Could not create connection to database server. Attempted reconnect 3 times. Giving up.)

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

Caused by: java.sql.SQLException: Access denied for user 'mcc'@'localhost' (using password: YES)

原因:

因爲項目是從SVN上導下來的,配置文件裏連接數據庫的數據庫名和密碼沒有改成自己本地數據庫的數據庫名和密碼

解決:將數據庫名和密碼改過來就好了

(已經第二次遇到這個問題了,記錄一下)



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章