# How to connect correct jdbc driver in pom

**URL:** <https://forum.liquibase.org/t/how-to-connect-correct-jdbc-driver-in-pom/6756>\
**Category:** Liquibase Development\
**Created:** [April 16, 2022, 6:16pm UTC](https://forum.liquibase.org/t/how-to-connect-correct-jdbc-driver-in-pom/6756 "2022-04-16T18:16:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![haso58](https://avatars.discourse-cdn.com/v4/letter/h/90ced4/32.png) [@haso58](https://forum.liquibase.org/u/haso58)\
**Post date:** [April 16, 2022, 6:16pm UTC](https://forum.liquibase.org/t/how-to-connect-correct-jdbc-driver-in-pom/6756/1 "2022-04-16T18:16:12Z")

</div>

I have a jhipster generated database, where I am trying to run this command:

```auto
mvn liquibase:diff

```

But right now I am getting the following error:

```auto
Failed to execute goal org.liquibase:liquibase-maven-plugin:4.6.1:diff (default-cli) on project product: 
Error setting up or running Liquibase:
liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Connection could not be created to hibernate:spring:com.moniesta.product.domain?dialect=&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy with driver com.mysql.jdbc.Driver. Possibly the wrong driver for the given database URL

```

My database is running in docker and is configured like this in its docker-compose:

```auto
  products-mysql:
    image: mysql:8.0.28
    platform: linux/x86_64
    environment:
      - MYSQL_ALLOW_EMPTY_PASSWORD=yes
      - MYSQL_DATABASE=products
    command: mysqld --lower_case_table_names=1 --skip-ssl --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
    ports:
      - '3306:3306'

```

This is how my pom is configured for the liquibase command:

```auto
               <configuration>
                        <changeLogFile>${project.basedir}/src/main/resources/config/liquibase/master.xml</changeLogFile>
                        <diffChangeLogFile>${project.basedir}/src/main/resources/config/liquibase/changelog/${maven.build.timestamp}_changelog.xml</diffChangeLogFile>
                        <driver>com.mysql.jdbc.Driver</driver>
                        <url>jdbc:mysql://localhost:3306/product?useUnicode=true&amp;characterEncoding=utf8&amp;useSSL=false&amp;useLegacyDatetimeCode=false&amp;serverTimezone=UTC&amp;createDatabaseIfNotExist=true</url>
                        <username>root</username>
                        <emptyPassword>true</emptyPassword>
                        <referenceDriver>com.mysql.jdbc.Driver</referenceDriver>
                        <contexts>local</contexts>
                        <referenceUrl>hibernate:spring:com.moniesta.product.domain?dialect=&amp;hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&amp;hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy</referenceUrl>
                        <verbose>true</verbose>
                        <logging>error</logging>
                        <contexts>!test</contexts>
                    </configuration>

```

I see it tries to connect to the database correctly but the driver fails, but this is a mysql database so should the driver be not mysql.jdbc? I am using mysql8

---

<div class="post-metadata">

**Author:** ![tabbyfoo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/tabbyfoo/32/748_2.png) [@tabbyfoo](https://forum.liquibase.org/u/tabbyfoo)\
**Post date:** [April 21, 2022, 7:24pm UTC](https://forum.liquibase.org/t/how-to-connect-correct-jdbc-driver-in-pom/6756/2 "2022-04-21T19:24:07Z")

</div>

Have you tried using this driver?

`com.mysql.cj.jdbc.Driver`
