问题
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