# Using Liquibase with both MongoDB and MySQL

**URL:** <https://forum.liquibase.org/t/using-liquibase-with-both-mongodb-and-mysql/5180>\
**Category:** General Discussion\
**Created:** [March 10, 2021, 1:32am UTC](https://forum.liquibase.org/t/using-liquibase-with-both-mongodb-and-mysql/5180 "2021-03-10T01:32:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecalkev](https://avatars.discourse-cdn.com/v4/letter/e/b5a626/32.png) [@ecalkev](https://forum.liquibase.org/u/ecalkev)\
**Post date:** [March 10, 2021, 1:32am UTC](https://forum.liquibase.org/t/using-liquibase-with-both-mongodb-and-mysql/5180/1 "2021-03-10T01:32:34Z")

</div>

I’m trying to run liquibase with MySQL and MongoDB instance. But when I try run the connection is failing with:

[ERROR] Error setting up or running Liquibase:  
[ERROR] liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Could not open connection to database: UNKNOWN: The connection string contains an invalid host ‘:’. The port ‘’ is not a valid, it must be an integer between 0 and 65535

My maven profile I am running is:

`  
liquibase-update  
  
\<liquibase.should.run\>true\</liquibase.should.run\>  
  
  
process-resources  
  
  
org.liquibase  
liquibase-maven-plugin  
4.3.1

```
					<dependencies>
						<dependency>
							<groupId>org.liquibase.ext</groupId>
							<artifactId>liquibase-mongodb</artifactId>
							<version>4.3.1</version>
						</dependency>
					</dependencies>

					<executions>
						<execution>
							<id>db1-update</id>

							<phase>process-resources</phase>
							<goals>
								<goal>update</goal>
							</goals>

							<configuration>

								<logging>info</logging>
								<promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
								<changeLogFile>./scripts/database/liquibase/changelogs/master-changelog.xml</changeLogFile>
								<driver>com.mysql.jdbc.Driver</driver>
								<url>${jdbc.url}</url>
								<username>${jdbc.username}</username>
								<password>${jdbc.password}</password>
							</configuration>
						</execution>

						<execution>
							<id>db2-update</id>

							<phase>process-resources</phase>
							<goals>
								<goal>update</goal>
							</goals>

							<configuration>

								<logging>info</logging>
								<promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
								<changeLogFile>./scripts/database/liquibase/mongo-changelogs/mongo-master-changelog.xml</changeLogFile>
								<driver>org.mongodb.mongodb-driver-sync</driver>
								<url>${mongo.url}</url>
								<username>${mongo.username}</username>
								<password>${mongo.password}</password>
							</configuration>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</build>
	</profile>`

```

Is liquibase able to run with a SQL and noSQL database like this or is my configuration wrong?

Thanks

---

<div class="post-metadata">

**Author:** ![ecalkev](https://avatars.discourse-cdn.com/v4/letter/e/b5a626/32.png) [@ecalkev](https://forum.liquibase.org/u/ecalkev)\
**Post date:** [March 12, 2021, 5:53pm UTC](https://forum.liquibase.org/t/using-liquibase-with-both-mongodb-and-mysql/5180/2 "2021-03-12T17:53:31Z")

</div>

The issue is related to: [Is this extension crush with postgreSQL? · Issue #87 · liquibase/liquibase-mongodb · GitHub](https://github.com/liquibase/liquibase-mongodb/issues/87)

Workaround solution: create 2 profiles (1 for SQL database, 1 for Mongo), add dependency for ` liquibase-mongodb` only in mongo profile, run these profiles as separate jobs to prevent `liquibase-mongodb` conflicting with liquibase for SQL.

---

<div class="post-metadata">

**Author:** ![alexandru.slobodcico](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/alexandru.slobodcico/32/334_2.png) [@alexandru.slobodcico](https://forum.liquibase.org/u/alexandru.slobodcico)\
**Post date:** [April 6, 2021, 12:58pm UTC](https://forum.liquibase.org/t/using-liquibase-with-both-mongodb-and-mysql/5180/3 "2021-04-06T12:58:03Z")

</div>

Thank you @ecalkev . The issue is being fixed,  
First in liquibase then the one you pointed out in extension.  
See: [Liquibabse commands are failing for other databases when mongodb jars are also present on classpath · Issue #1782 · liquibase/liquibase · GitHub](https://github.com/liquibase/liquibase/issues/1782)  
and the discussion related in :  
[Liquibabse command failure when mongo jars are present on classpath - #16 by daryldoak](https://forum.liquibase.org/t/liquibabse-command-failure-when-mongo-jars-are-present-on-classpath/5269/16)
