Most Suitable CHARSET and COLLATE for Dolibarr Database

I’ve been installing successive versions of Dolibarr for years (from version 5 to the current 22!) and it has always been a mystery to me—and I think to most of us—how to properly choose the right CHARSET and COLLATE when creating a new MySQL or MariaDB database for Dolibarr.

But now, thanks to the incredible AI-powered search engines we have today (I highly recommend trying Perplexity’s paid version if you haven’t), I finally decided to ask while setting up a fresh Dolibarr 22 installation.

The Short Version

The recommended command for database creation is:

CREATE DATABASE dolibarr22 
DEFAULT CHARACTER SET utf8mb4 
COLLATE utf8mb4_unicode_ci;

If you search this forum, you’ll find all kinds of answers because the “correct” one has evolved over time as hardware and software (MySQL, MariaDB) technologies have advanced.

The Long Version

Here’s the SUPER-WELL-DOCUMENTED answer from Perplexity, explaining in detail the consequences of use these u others CHARSETS & COLLATES:

:link: Link to Perplexity’s detailed response


Disclaimer: I’m not part of Dolibarr’s official development team. If Eldy or anyone else thinks I’m wrong or that this needs correction, please feel free to chime in!

1 Like