Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues connecting to mariadb linux socket #2136

ghost opened this issue Sep 6, 2018 · 3 comments

Issues connecting to mariadb linux socket #2136

ghost opened this issue Sep 6, 2018 · 3 comments


Copy link

ghost commented Sep 6, 2018

Which version and edition of Flyway are you using?

Flyway Community Edition 5.1.4 by Boxfuse

If this is not the latest version, can you reproduce the issue with the latest one as well?

(Many bugs are fixed in newer releases and upgrading will often resolve the issue)
I think it's the latest release.

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)


Which database are you using (type & version)?

Server version: 10.1.34-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04

Which operating system are you using?

Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic

What did you do?

(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.)

alice@fun1:/home/ss13/Daedalus-of-Freedom$ /opt/flyway-5.1.4/flyway -n -user=alice -url=jdbc:mariadb://localhost:3306/mysql?localSocket=/var/run/mysqld/mysqld.sock migrate
Flyway Community Edition 5.1.4 by Boxfuse

Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jna/LastErrorException
        at org.mariadb.jdbc.internal.util.Utils.createSocket(
        at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connect(
        at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(
        at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(
        at org.mariadb.jdbc.MariaDbConnection.newConnection(
        at org.mariadb.jdbc.Driver.connect(
        at org.flywaydb.core.internal.util.jdbc.DriverDataSource.getConnectionFromDriver(
        at org.flywaydb.core.internal.util.jdbc.DriverDataSource.getConnection(
        at org.flywaydb.core.internal.util.jdbc.JdbcUtils.openConnection(
        at org.flywaydb.core.internal.database.DatabaseFactory.createDatabase(
        at org.flywaydb.core.Flyway.execute(
        at org.flywaydb.core.Flyway.migrate(
        at org.flywaydb.commandline.Main.executeOperation(
        at org.flywaydb.commandline.Main.main(
Caused by: java.lang.ClassNotFoundException: com.sun.jna.LastErrorException
        at java.lang.ClassLoader.loadClass(
        at sun.misc.Launcher$AppClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        ... 14 more
What did you expect to see?

That it connected to the database

What did you see instead?

The error above.

@ghost ghost changed the title Issues connecting to mysql socket Issues connecting to mariadb linux socket Sep 6, 2018
Copy link

axelfontaine commented Sep 7, 2018

Thanks for reporting. It appears the MariaDB JDBC driver optionally requires JNA (which Flyway doesn't ship with) and this must be a case where it is used.

Can you try downloading and, adding these 2 jar files to Flyway's drivers directory and then try to connect again to see if this fixes the issue?

Copy link

ghost commented Sep 7, 2018

Works perfectly! Thank you!

Copy link

Thanks for testing. Then we'll include these out of the box, starting with Flyway 5.2.

@axelfontaine axelfontaine added this to the Flyway 5.2.0 milestone Sep 7, 2018
axelfontaine pushed a commit to flyway/ that referenced this issue Sep 18, 2018
dohrayme pushed a commit to dohrayme/flyway that referenced this issue Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

1 participant