【发布时间】:2021-07-05 22:41:25
【问题描述】:
我尝试在我的 grails 3.3.9 项目中连接一个 postgres 数据库; 我的 posgrest 服务器正在工作,因为我可以从 Intelli J 2021 数据库连接和操作 posgres 数据库,但我无法连接到 grails 3.3.9。 密码和用户是正确的,但它总是给我这个错误:
Running application...
2021-07-05 19:06:25.298 ERROR --- [ main] org.postgresql.Driver : Connection error:
org.postgresql.util.PSQLException: El servidor requiere autenticación basada en contraseña, pero no se ha provisto ninguna contraseña.
还有这个 mi Application.yml
hibernate:
cache:
queries: false
use_second_level_cache: false
use_query_cache: false
dataSource:
IkebanaUsuarios:
pooled: true
jmxExport: true
driverClassName: "org.postgresql.Driver"
username: "postgres"
password: "postgres"
environments:
development:
dataSource:
dbCreate: update
url: jdbc:postgresql://localhost:5432/IkebanaERP
test:
dataSource:
dbCreate: update
url: jdbc:postgresql://localhost:5432/IkebanaERP
production:
dataSource:
dbCreate: update
url: jdbc:postgresql://localhost:5432/IkebanaERP
properties:
jmxEnabled: true
initialSize: 5
maxActive: 50
minIdle: 5
maxIdle: 25
maxWait: 10000
maxAge: 600000
timeBetweenEvictionRunsMillis: 5000
minEvictableIdleTimeMillis: 60000
validationQuery: SELECT 1
validationQueryTimeout: 3
validationInterval: 15000
testOnBorrow: true
testWhileIdle: true
testOnReturn: false
jdbcInterceptors: ConnectionState
defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED
而我的 build.graddle 就是这个
.......
compile "org.grails.plugins:cache"
compile "org.grails.plugins:async"
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:events"
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:5.1.16.Final"
compile "org.grails.plugins:gsp"
console "org.grails:grails-console"
profile "org.grails.profiles:web"
runtime "org.glassfish.web:el-impl:2.1.2-b03"
runtime "com.h2database:h2"
runtime "org.apache.tomcat:tomcat-jdbc"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.15.1"
runtime 'org.xerial:sqlite-jdbc:3.6.17'
runtime 'org.postgresql:postgresql:9.4.1208.jre1.8'
runtime 'mysql:mysql-connector-java:5.1.29'
runtime 'org.postgresql:postgresql:42.2.1.jre7'
testCompile "org.grails:grails-gorm-testing-support"
testCompile "org.grails.plugins:geb"
testCompile "org.grails:grails-web-testing-support"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
}
请帮忙;非常感谢
【问题讨论】:
标签: database postgresql gradle grails yaml