Adding and Updating Liquibase Drivers
To establish a connection between Liquibase and your database, you must store the JDBC driver for your database version as a JAR file in your $LIQUIBASE_HOME/lib
folder.
Tip: $LIQUIBASE_HOME is an environment variable that points to the location of the directory where Liquibase is installed on your machine. You can set environment variables using your operating system's shell. The location of $LIQUIBASE_HOME will depend on where Liquibase was installed on your machine.
Tip: If you installed with Homebrew, you can find the/lib
directory under /opt/homebrew/Cellar/liquibase/4.32.0/libexec/lib
. Rather than add the drivers to this directory, we recommend creating a liqubase_libs directory in the current working directory so you can chose a location that is easier for you to find. See How Liquibase Finds Files: Liquibase Search Path for more information. Homebrew installation is only available in Liquibase OSS.
Liquibase comes with pre-installed drivers for the following databases in the $LIQUIBASE_HOME/internal/lib
folder:
To use another database with Liquibase, you must add the appropriate database driver to $LIQUIBASE_HOME/lib
. You can download a database's JDBC driver from its website. To replace a pre-installed driver, delete or rename the existing JDBC file in $LIQUIBASE_HOME/internal/lib
and add the new one in $LIQUIBASE_HOME/lib
.
Tip: For a full list of drivers for databases supported by Liquibase, see Liquibase Database Tutorials. For a list of databases whose extensions are community-maintained, see Liquibase Database Tutorials: Community-Maintained.
If you specify a value for the driver in the Liquibase properties file, in the CLI, or as an environment variable, make sure it matches the appropriate driver in $LIQUIBASE_HOME/internal/lib
or $LIQUIBASE_HOME/lib
.
If you downloaded a driver a placed it in a directory other than the recommended $LIQUIBASE_HOME/lib
, you must set the classpath
in your Liquibase properties file to the path to that directory. For more information, see Create and Configure a liquibase.properties File.
Maven
If you use Liquibase with Maven, you can specify the driver in your pom.xml
file:
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>13.3.0.0</version>
</dependency>