0

I have a Drupal 9.4.8 website a MariaDB database and phpMyAdmin.

My website is already active with data in its 220 MB database.

How to upgrade a MariaDB database to utf8mb4_unicode_ci ?

Here is my website setup :

enter image description here

Here is the current database. It's really a mess, because there's utf8_general_ci and utf8mb4_general_ci :

enter image description here

If updating is possible, can it break Drupal ?

  • What version of MariaDB? What character set is currently in use? Questions about MariaDB are better handled in stackoverflow.com or dba.stackexchange.com . – Rick James Dec 02 '22 at 23:50

1 Answers1

0

Following the directions from here, you should be able to get away with

ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4_unicode_ci COLLATE utf8mb4_unicode_ci;

You will need to run this command separately on each table. You will also want to set the parameter character_set_server in your configuration file to make it the default going forward.

Whether or not it breaks drupal is probably dependent on your particular installation. Always back everything up before you make changes and test immediately after the change.

doneal24
  • 851
  • 6
  • 14
  • https://ibb.co/gvLm70m I tried with phpmyadmin, but I have an error and I don't know what to do – Mathieu Dec 01 '22 at 22:16
  • I got 2 errors. An error with the cache and an error with the search index. I followed this tutorial with phpmyadmin https://mariushosting.com/phpmyadmin-how-to-convert-utf8_general_ci-database-to-utf8mb4_unicode_ci/ my salvation was just to clear cache and search index. Now all the tables and my columns are in utf8mb4_unicode_ci My question, should I restore my Database because there were errors or you are ok. – Mathieu Dec 02 '22 at 00:00
  • With each error corrected I redid step 6 of the tutorial. Until all tables and columns are in utf8mb4_unicode_ci is this good practice or should I restore? This is my first database update. – Mathieu Dec 02 '22 at 00:01