0 votes
1 view
in SQL by (5k points)

I have created a simple Maven project to access my MySQL / MariaDB database. To download the proper database connector jar file, I'm adding the following Maven dependency:

<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.47</version> <scope>provided</scope> </dependency>

I am using the 5.1.47 version above by chance, because of the previous project on my PC. 

But when I check the version, it displays the following:

>mysql -V mysql Ver 15.1 Distrib 10.4.6-MariaDB, for Win64 (AMD64), source revision b8e655ce029a1f182602c9f12c3cc5931226eec2

 

But that 10.4.6 version is not much of use in terms of determining a proper version to set up my Maven dependency.

In what way can I determine the MySQL version for Maven dependency based on my local MySQL / MariaDB server?

1 Answer

0 votes
by (10.2k points)

This cannot be determined because they are completely different things. Maven is nothing but the client version and for which you are checking with MySQL -V is the server version. There is no need to match the JDBC client version exactly.

Rather, you have to ensure the server support for the client version that you used.

If you read its docs, 5.1.47 should support MySQL 5.61, 5.71, 8.0. But you can update the client to version 8.0 series, which is the official recommendation and should also work with your existing MariaDB version.

If you want to get more insights into SQL, checkout this SQL Course from Intellipaat.

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !

Categories

...