Premise: I ship a Java application which will make a JDBC connection to a MySQL database. (At the time of this writing it could be 5.1 or 5.5, but hopefully the question and answer don't rely heavily on the version.)

Observation: Clearly, I can use the the MySQL JDBC driver (Connector/J) or the MariaDB JDBC driver (MariaDB Java Client) to make the connection to the MySQL server. One huge benefit from the standpoint of an ISV is that the MariaDB driver is LGPL licensed while the MySQL driver is GPL licensed. Performance of the MariaDB driver seems very good.

Question: To what extent is the MariaDB JDBC driver a perfect replacement for the MySQL JDBC driver?

I'm not looking for a debate on the relative merits of the two. But rather I'm hoping someone can answer along the lines of one of these:

  • The MariaDB JDBC driver has important issues with X and Y, so you'll have troubles if you use either of these.
  • Based on some article or specification or code or other evidence, the MariaDB JDBC driver fully implements [at least] all methods available in the MySQL driver. You'll be fine.
  • The MariaDB client handles prepared statements on the client side. That might be an issue.
    – Mat
    Commented Jun 16, 2013 at 9:31
  • 1
    I can add that I have not encountered any problems. That's hardly a comprehensive answer, but it's a good sign.
    – mdahlman
    Commented Oct 7, 2013 at 19:46
  • @Mat Update: There's useServerPrepStmts since 1.3.0, since 1.6.0 it's off by default. No idea why.
    – maaartinus
    Commented Jun 5, 2017 at 22:11

2 Answers 2


I'm getting a bit nervous. (*)

First, the upside: I've used the MariaDB JDBC driver in an "always on" service in production with a database connection pool and it is running fine for a couple of months now. The service only uses basic JDBC functions with simple queries (e.g. no joins, no blobs). I'm about to release another "always on" service that uses the MariaDB JDBC driver in a similar fashion.
I decided to use the MariaDB JDBC driver after (re)viewing the source code: compared to the Oracle MySQL JDBC driver source code the the MariaDB JDBC driver source code is a lot more readable and understandable.

But I get the impression (9/2014) development has slowed down (link is to a graph showing bugs created vs. resolved). If I browse through the open bugs I see many serious bugs open for far too long (issues with Hibernate and also time-zones/dates). Some of these may not be bugs but then they should have been closed by now. I also encountered one bug (via STASH-4012) that should be re-opened: bug CONJ-72 is closed but the last comment (from 4/2014) indicates the problem is not resolved for Hibernate.

All in all I do not consider the MariaDB JDBC driver a perfect replacement for the Oracle MySQL JDBC driver. I'm happy to continue to use it for the simple stuff (where all queries are known beforehand and tested) for now, but I might have to switch back to the Oracle MySQL JDBC driver in the future.

(*) Things have changed (for the better I think) since 2014, the updated links (2024) should reflect this.

  • 2
    Development picked up in November 2014. Click the 'slowed down' link in vanOekel's response for an update. There was a new stable release in January 2015. Commented Feb 26, 2015 at 22:21

One other thing to keep in mind is that you have no choice if you want to distribute non-GPL software. If you distribute software under any license but the GPL, Oracle could sue you for copyright infringement if you use their drivers.

  • You have a choice. You can hand money to Oracle and they will allow you to use the client with a commercial license!
    – Josef
    Commented Mar 13, 2017 at 10:02
  • I'm not a lawyer but one possible choice for some deployments may be to not "ship" your software with the Oracle MySQL JDBC driver but instead require the end user to download the Oracle MySQL JDBC driver themselves.
    – buzz3791
    Commented Apr 24 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.