2 回答

TA貢獻(xiàn)3593條經(jīng)驗(yàn) 獲得超0個(gè)贊

TA貢獻(xiàn)63條經(jīng)驗(yàn) 獲得超16個(gè)贊
可能有一下原因造成:
1,驅(qū)動(dòng)配置有誤:driver=com.mysql.jdbc.Driver
2,數(shù)據(jù)庫連接地址有誤:url=jdbc:mysql://localhost:3306/test?3useUnicode=true&characterEncoding=utf8
3,密碼或帳號(hào)有誤:username=root
????? password=root
4,數(shù)據(jù)庫未啟動(dòng)或無權(quán)訪問
5,項(xiàng)目未引入對(duì)應(yīng)的驅(qū)動(dòng)jar包mysql-connector-java-5.1.6-bin.jar
6,mysql root沒有遠(yuǎn)程訪問的權(quán)限,需要增加權(quán)限,增加權(quán)限的步驟如下:
進(jìn)入mysql數(shù)據(jù)庫:
grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
flush privileges;
添加回答
舉報(bào)