第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

spring boot 無法連接數(shù)據(jù)庫

spring boot 無法連接數(shù)據(jù)庫

白豬掌柜的 2024-01-17 16:44:22
我嘗試使用數(shù)據(jù)庫連接構(gòu)建 RestFull Web 服務(wù)。但這似乎沒有與數(shù)據(jù)庫連接。我在控制臺中收到此錯(cuò)誤。   com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure    The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.        at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-java-8.0.18.jar:8.0.18]        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) ~[mysql-connector-java-8.0.18.jar:8.0.18]        at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836) ~[mysql-connector-java-8.0.18.jar:8.0.18]The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_162]    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[na:1.8.0_162]    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[na:1.8.0_162]Caused by: java.net.UnknownHostException: db_example    at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.8.0_162]    at java.net.InetAddress$2.lookupAllHostAddr(Unknown Source) ~[na:1.8.0_162]Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]    at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:275) ~[hibernate-core-5.4.6.Final.jar:5.4.6.Final]    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237) ~[hibernate-core-5.4.6.Final.jar:5.4.6.Final]這是我的 application.property 文件我不明白這有什么問題。
查看完整描述

2 回答

?
肥皂起泡泡

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

我認(rèn)為這里的主機(jī)名有問題。因此,請檢查一次主機(jī)名,例如 localhost(或)您正確的數(shù)據(jù)庫托管地名。

因?yàn)樗@示像unknownHostException這樣的異常。


查看完整回答
反對 回復(fù) 2024-01-17
?
藍(lán)山帝景

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

查看完整回答
反對 回復(fù) 2024-01-17
?
瀟湘沐

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

  spring.datasource.url=jdbc:mysql://localhost:3306/db_example

    spring.datasource.username = root

    spring.datasource.password = root

    spring.jpa.properties.hibernate.dialect =org.hibernate.dialect.MySQL5Dialect


hibernate.dialect=org.hibernate.dialectMySQL5Dialect

hibernate.show_sql=true

hibernate.hbm2ddl.auto=create

hibernate.ddl-auto=validate


hibernate.connection.url=jdbc:mysql://localhost:3306/axa_india?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull

hibernate.connection.username=root

hibernate.connection.password=root


查看完整回答
反對 回復(fù) 2024-01-17
  • 2 回答
  • 0 關(guān)注
  • 281 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號