daydreamer
daydreamer

Reputation: 91957

How to create database with Liquibase

When I run mvn clean install, I see error as

Failed to execute goal org.liquibase:liquibase-maven-plugin:3.1.1:update (default) on project database_seed: Error setting up or running Liquibase: liquibase.exception.DatabaseException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user ''@'localhost' to database 'myApp' -> [Help 1]

How do I fix it?

Upvotes: 9

Views: 24141

Answers (1)

matt
matt

Reputation: 9401

Looks like you're not passing a username or password as part of your config:

(from the liquibase maven documentation)

<configuration>
  <changeLogFile>src/main/resources/changelog.xml</changeLogFile>
  <driver>com.mysql.jdbc.Driver</driver>
  <url>jdbc:mysql://localhost:3306/myApp?createDatabaseIfNotExist=true</url>
  <username>liquibaseTest</username>
  <password>pass</password>
</configuration>

Upvotes: 11

Related Questions