0
這裏是我有問題與谷歌項目的MySQL Db連接,我創建了這個數據庫與終端名稱汽車一切都是okey。但是,當我嘗試運行我的應用程序時,出現此錯誤。Grails&Mysql連接映射值不允許在這裏
| Error Error occurred running Grails CLI: mapping values are not allowed here
in 'reader', line 107, column 17:
url: "jdbc:mysql://localhost:3306/cars"
^
(Use --stacktrace to see the full trace)
,這裏是我的application.yml文件
dataSource:
pooled: true
jmxExport: true
driverClassName: "com.mysql.jdbc.Driver"
username: "root"
password: "1234"
environments:
development:
dataSource:
dbCreate: update
url: "jdbc:mysql://localhost:3306/cars"
test:
dataSource:
dbCreate: update
url: "jdbc:mysql://localhost:3306/cars"
production:
dataSource:
dbCreate: none
url: "jdbc:mysql://localhost:3306/cars"
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.gradle文件我已經添加到依賴性這一
runtime 'mysql:mysql-connector-java:5.1.29'
不工作,是同 –
我同樣的結果進行了測試:只是刪除「測試」塊中「url」前面的空格。或者修復「測試」模塊以進一步調試。 – gregorr