当前位置: 首页 > 工具软件 > Open Dialect > 使用案例 >

mysql cannot open connection_出现Cannot open connection

冯育
2023-12-01

com.mysql.jdbc.Driver

jdbc:mysql://127.0.0.1:1433/jsp

root

123456

org.hibernate.dialect.MySQLDialect

2

2

create

Exception in thread "main" org.hibernate.exception.JDBCConnectionException: Cannot open connection

at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:97)

at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)

at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)

at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)

at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)

at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)

at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1354)

at com.test.h1.Base.main(Base.java:19)

Caused by: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException

MESSAGE: Connection reset

STACKTRACE:

java.net.SocketException: Connection reset

at java.net.SocketInputStream.read(SocketInputStream.java:168)

at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)

at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)

at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)

at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1931)

at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:483)

at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:992)

at com.mysql.jdbc.Connection.createNewIO(Connection.java:2568)

at com.mysql.jdbc.Connection.(Connection.java:1485)

at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)

at java.sql.DriverManager.getConnection(DriverManager.java:582)

at java.sql.DriverManager.getConnection(DriverManager.java:154)

at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)

at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)

at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)

at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)

at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)

at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1354)

at com.test.h1.Base.main(Base.java:19)

** END NESTED EXCEPTION **

Last packet sent to the server was 1 ms ago.

at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:554)

at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:992)

at com.mysql.jdbc.Connection.createNewIO(Connection.java:2568)

at com.mysql.jdbc.Connection.(Connection.java:1485)

at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)

at java.sql.DriverManager.getConnection(DriverManager.java:582)

at java.sql.DriverManager.getConnection(DriverManager.java:154)

at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)

at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)

... 5 more

2012年11月09日 11:25

 类似资料: