1.在使用java連接數(shù)據(jù)庫JDBC時,出現(xiàn)報錯java.sql.SQLNonTransientConnectionException: Could not create connection to database server.
2.問題原因:mysql版本問題,需要下載對應的mysql版本,而且要下載對應mysql-connector的jar包版本。
3.win+r 輸入cmd,查看mysql版本號.
4.下載對應的mysql版本,下載地址:https://downloads.mysql.com/archives/c-j/文章來源:http://www.zghlxwxcb.cn/news/detail-547908.html
5 .安裝好mysql后,最后需要在pom.xml修改mysql依賴版本,然后刷新maven工程,最后問題解決!文章來源地址http://www.zghlxwxcb.cn/news/detail-547908.html
到了這里,關于項目報錯:java.sql.SQLNonTransientConnectionException:Could not create connection to database server解決辦法的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!