Liquibase拒绝创建不存在的数据库 [英] Liquibase refuses to create a database that doesn't exist

查看:521
本文介绍了Liquibase拒绝创建不存在的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试

liquibase update

在尚不存在的数据库上.我希望它可以为我创建数据库(我使用root运行,所以应该没有问题),但是我却得到了:

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'

推荐答案

再次将连接网址参数解救!

Connection url parameters to the rescue again!

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

createDatabaseIfNotExist=true部分起到了作用

这篇关于Liquibase拒绝创建不存在的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆