Liquibase refuses to create a database that doesn't exist

假如想象 提交于 2019-12-23 12:02:05

问题


I'm trying to run

liquibase update

on a database that doesn't exist yet. I would expect it to create the database for me (I'm running with root, so it shouldn't be a problem), but instead I'm getting:

/vagrant/liquibase$ ./liquibase update
Liquibase Home is not set.
Liquibase Home: /vagrant/liquibase
Liquibase update Failed: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'test_project'

回答1:


Connection url parameters to the rescue again!

url: jdbc:mysql://localhost/dev_project?allowMultiQueries=true&createDatabaseIfNotExist=true

the createDatabaseIfNotExist=true part did the trick



来源:https://stackoverflow.com/questions/18322876/liquibase-refuses-to-create-a-database-that-doesnt-exist

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!