Applies to
- Liquibase Pro
- Liquibase Open Source (Community)
Conditions
- Any supported database
Issue Summary
When running Liquibase, the process fails with an error message stating that the driver class was not specified and could not be determined from the database URL. This issue prevents Liquibase from connecting to the database and executing the desired commands.
Error Message
Root Cause
The error occurs because Liquibase cannot determine the correct database driver to use. This could happen due to one or more of the following reasons:
- The
url
parameter is malformed or does not match a recognized database type. - The necessary database driver JAR is not included in the Liquibase classpath.
- The
liquibase.properties
file or command-line arguments are missing thedriver
parameter.
Resolution
Step 1: Check the Database URL
Ensure the database URL is correct and matches the format Liquibase expects.
For example:
- PostgreSQL:
jdbc:postgresql://host:port/database
- MySQL:
jdbc:mysql://host:port/database
- Oracle:
jdbc:oracle:thin:@host:port:SID
You can find a complete list of examples on the Liquibase Database Tutorials page.
Step 2: Add the Database Driver to the Classpath
Ensure that the appropriate database driver JAR file is available in the Liquibase classpath.
- Download the driver JAR for your database (e.g.,
postgresql-<version>.jar
for PostgreSQL). - Place the JAR file in the
liquibase/lib
directory.
You can find a complete list of drivers on the Liquibase Database Tutorials page.
Step 3: Verify and Specify the Database Driver
Ensure that the correct database driver is specified in the liquibase.properties
file or as a command-line argument.
Example in liquibase.properties
:
Command-line Example:
You can find a complete list of driver classes on the Liquibase Database Tutorials page.
Comments
0 comments
Article is closed for comments.