无法连接到amazon web服务器上托管的mysql数据库

fcy6dtqo  于 2021-06-19  发布在  Mysql
关注(0)|答案(0)|浏览(241)

错误类型

Type Exception Report

Message Request processing failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
    org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:877)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

我已经创建了一个简单的springmvc应用程序,它与数据库连接起来,在本地一切都很好localhost:8080 but 当我在aws中托管时,我无法将我的应用程序与数据库连接起来,我在aws的mysql中创建了数据库和表。

<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
    <session-factory>
        <!-- JDBC Database connection settings -->
        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="connection.url">jdbc:mysql://34.201.126.236:3306/dbName?useSSL=false</property>
        <property name="connection.username">root</property>
        <property name="connection.password">secretPassword</property>
        <!-- JDBC connection pool settings ... using built-in test pool -->
        <property name="connection.pool_size">10</property>
        <!-- Select our SQL dialect -->
        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
        <!-- Echo the SQL to stdout -->
        <property name="show_sql">true</property>
        <!-- Set the current session context -->
        <property name="current_session_context_class">thread</property>
    </session-factory>
</hibernate-configuration>

有什么问题?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题