我试图连接到Spring应用程序中的本地数据库,这会使H2处于混合模式。我试图连接到DBeaver,但我得到以下消息:
org.h2.jdbc.JdbcSQLInvalidAuthorizationSpecException: Nombre de usuario ó password incorrecto
Wrong user name or password [28000-200]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:461)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:429)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.message.DbException.get(DbException.java:170)
at org.h2.server.TcpServer.checkKeyAndGetDatabaseName(TcpServer.java:527)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:137)
at java.base/java.lang.Thread.run(Thread.java:832)
Nombre de usuario ó password incorrecto
Wrong user name or password [28000-200]
数据偏移:
Parameters and URL
Spring中的属性:
server.port = 8080
spring.datasource.url=jdbc:h2:file:./data/demo;AUTO_SERVER=TRUE;AUTO_SERVER_PORT=9090;DB_CLOSE_DELAY=-1;PASSWORD=password;USER=sa
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.h2.console.enabled=true
spring.jpa.hibernate.ddl-auto=update
我尝试了各种方法,但无法从DBeaver连接。有人遇到过类似的问题吗?非常感谢大家!
1条答案
按热度按时间uinbv5nw1#
只能在本地计算机上连接。
为此,请选择“通过URL连接”并在此处输入您的URL。对于在服务器上连接,您只能使用浏览器控制台http://www.h2database.com/html/features.html#auto_mixed_mode
DBeaver image. How to connect to local machine