Failed to initialize JPA EntityManagerFactory: Unable to create requested service


1、錯誤場景
2022-01-25 10:56:57.142 ERROR 18484 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

2、錯誤原因
MySQL數據庫

3、解決辦法
1)檢查MySQL服務有沒有打開

2)檢查項目的數據源配置是否錯誤,如用戶名或者密碼錯誤,url語法錯誤導致無法正常訪問等。(自身所犯錯誤:url寫錯。是jdbc:mysql://...卻錯寫成cj.jdbc:mysql//...)

核對自己的用戶名、密碼、端口號等。diver—class—name這個參數的寫法也要注意,高版本(即8.0及以上)的MySQL數據庫是cj.jdbc.driver而不是jdbc.driver

參考網址
https://blog.csdn.net/air__Heaven/article/details/119960013
https://blog.csdn.net/xiaozhegaa/article/details/69230127
https://www.cnblogs.com/Ran-Chen/p/9646187.html
https://blog.csdn.net/weixin_42125700/article/details/80245177
https://blog.csdn.net/wdxgj123/article/details/106603704
https://blog.51cto.com/zero01/2294152
https://www.cnblogs.com/borter/p/12424049.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM