Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Liquibase refuses to create a database that doesn't exist

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'
like image 980
atamur Avatar asked Mar 23 '23 17:03

atamur


1 Answers

Connection url parameters to the rescue again!

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

the createDatabaseIfNotExist=true part did the trick

like image 173
atamur Avatar answered Apr 06 '23 06:04

atamur