用戶名和密碼都正確,總是出現下面問題,誰可以幫忙解決啊,謝謝
Could not obtain connection to query metadata : Access denied for user ''@'localhost' (using password: YES)
Could not obtain connection to query metadata : Access denied for user ''@'localhost' (using password: YES)
舉報
2017-07-18
1,驅動配置有誤:driver=com.MySQL.jdbc.Driver
2,數據庫連接地址有誤:url=jdbc:mysql://localhost:3306/test?3useUnicode=true&characterEncoding=utf8
3,密碼或帳號有誤:username=root ? ? ? ? ??password=root
4,數據庫未啟動或無權訪問
5,項目未引入對應的驅動jar包mysql-connector-Java-5.x.x-bin.jar
6,mysql root沒有遠程訪問的權限,需要增加權限,增加權限的步驟如下:
進入mysql數據庫:
grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
flush privileges;