# Which dialect should I use?

**URL:** <https://discourse.hibernate.org/t/which-dialect-should-i-use/7404>\
**Category:** Hibernate ORM\
**Created:** [March 18, 2023, 6:53pm UTC](https://discourse.hibernate.org/t/which-dialect-should-i-use/7404 "2023-03-18T18:53:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iwitrag](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/iwitrag/32/945_2.png) [@Iwitrag](https://discourse.hibernate.org/u/Iwitrag)\
**Post date:** [March 18, 2023, 6:53pm UTC](https://discourse.hibernate.org/t/which-dialect-should-i-use/7404/1 "2023-03-18T18:53:48Z")

</div>

Hello,

I’m configuring Hibernate for our project. On the server, we use 10.4.27-MariaDB, and we use Hibernate 6.1.7.Final.  
Now I’m having problems configuring correct dialect. When I tried to let Hibernate detect dialect, it has detected it as MySQL 5, which was incorrect.

So I have tried org.hibernate.dialect.MariaDB103Dialect, but now I see a warning that it is deprecated and I should use generic MariaDBDialect.

So I have used MariaDBDialect, but now I’m getting this warning:

[org.hibernate.dialect.Dialect] HHH000511: The 5.5.0 version for [org.hibernate.dialect.MariaDBDialect] is no longer supported, hence certain features may not work properly. The minimum supported version is 5.7.0. Check the community dialects project for available legacy versions.

So - which dialect should I use? This is very confusing as it seems that none dialect is correct.

Thank you!

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [March 20, 2023, 11:36am UTC](https://discourse.hibernate.org/t/which-dialect-should-i-use/7404/2 "2023-03-20T11:36:55Z")

</div>

You don’t need to configure a dialect. Hibernate will detect that automatically on startup. Either way, the `MariaDBDialect` is the correct one. On bootstrap, Hibernate will use a JDBC connection to determine the version number of the database and configure the dialect accordingly, unless you configured `hibernate.temp.use_jdbc_metadata_defaults=false`, which you really shouldn’t.

---

<div class="post-metadata">

**Author:** ![Iwitrag](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/iwitrag/32/945_2.png) [@Iwitrag](https://discourse.hibernate.org/u/Iwitrag)\
**Post date:** [March 20, 2023, 11:59am UTC](https://discourse.hibernate.org/t/which-dialect-should-i-use/7404/3 "2023-03-20T11:59:01Z")

</div>

Okay, thank you! So I will assume Hibernate detecting MySQL 5 instead of MariaDB 10.4 when dialect is not specified as safe and intended behaviour.

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [March 20, 2023, 12:10pm UTC](https://discourse.hibernate.org/t/which-dialect-should-i-use/7404/4 "2023-03-20T12:10:59Z")

</div>

No, this behavior is not intended. Hibernate should detect that you are running MariaDB. Which JDBC drivers are you using? You must use the JDBC drivers for MariaDB, not the MySQL ones.

---

<div class="post-metadata">

**Author:** ![Iwitrag](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/iwitrag/32/945_2.png) [@Iwitrag](https://discourse.hibernate.org/u/Iwitrag)\
**Post date:** [March 20, 2023, 12:59pm UTC](https://discourse.hibernate.org/t/which-dialect-should-i-use/7404/5 "2023-03-20T12:59:06Z")

</div>

I’m sorry for mystification beikov, it is indeed working correctly. It was an error on my side - I used com.mariadb.jdbc instead of org.mariadb.jdbc - it failed - and defaulted to MySQL connector (which is default fallback driver in our project).

Now everything works correctly and Hibernate is indeed very capable of detecting correct dialect.

Thanks for your help!
