Re-Create views, functions and triggers to avoid collation misma

A workflow often needed after database imports

MariaDB is very strict with mixed collations. When a function with a string modifier (like replace) was created in utf8_unicode_ci (default in phpMyAdmin) but the rest of the database uses utf8mb4_general_ci, you will get a mismatch error. Unfortunately, it is not possible to convert all functions or views to a new collation with a single command. Instread, it is easier to re-create them:

Views

Routines (functions and procedures)

Triggers

Use the line
.\mysqldump -u USER --default-character-set=utf8mb4 --skip-comments --no-data --no-create-info --skip-events --triggers --add-drop-trigger --result-file="triggers.sql" "DATABASE"

Adjust the phpMyAdmin config file:

If you have access to config.inc.php (with xampp under c:/xampp/phpMyAdmin), you can add:
$cfg['DefaultConnectionCollation'] = 'utf8mb4_general_ci';