gpt4 book ai didi

grails - 无法为 Grails 创建加密的 H2 数据库

转载 作者:行者123 更新时间:2023-12-02 13:57:40 25 4
gpt4 key购买 nike

我有一个 grails 项目,我需要在其中创建一个加密的 H2 数据库,但我不确定如何使其工作。这是我在 DataSource.groovy 中的内容:

dataSource {
pooled = true
driverClassName = "org.h2.Driver"
dialect = "org.hibernate.dialect.H2Dialect"
dbCreate = "update" // one of 'create', 'create-drop','update'
url = "jdbc:h2:/opt/viewpoint/data/h2/viewpoint;MODE=MYSQL;CIPHER=AES"
user = "sa"
pwds = "filepwd password"
}

当我运行它时,我得到以下信息:
Caused by: org.h2.jdbc.JdbcSQLException: Wrong password format, must be: file password <space> user password [90050-117]
at org.h2.message.Message.getSQLException(Message.java:105)
at org.h2.message.Message.getSQLException(Message.java:116)
at org.h2.message.Message.getSQLException(Message.java:75)
at org.h2.message.Message.getSQLException(Message.java:151)
at org.h2.engine.ConnectionInfo.convertPasswords(ConnectionInfo.java:264)
at org.h2.engine.ConnectionInfo.<init>(ConnectionInfo.java:72)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:94)
at org.h2.Driver.connect(Driver.java:58)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at $Proxy46.getMetaData(Unknown Source)
... 23 more

最佳答案

我不确定您从哪里获得数据源配置示例,但您需要使用 usernamepassword而不是 userpwds :

dataSource {
pooled = true
// ...
username = "sa"
password = "filepwd password"
}

关于grails - 无法为 Grails 创建加密的 H2 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12608565/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com