Skip to content

Instantly share code, notes, and snippets.

@kallookoo
Last active July 31, 2025 08:39
Show Gist options
  • Save kallookoo/2a493273ef934c50fccb6f2dbca55509 to your computer and use it in GitHub Desktop.
Save kallookoo/2a493273ef934c50fccb6f2dbca55509 to your computer and use it in GitHub Desktop.
Solution sql not utf8 chars

Possible solution

  • Export the database
sudo mariadb-dump --default-character-set=latin1 database > database.sql

Remplace mariadb-dump by mysqldump for MySQL

  • Edit the database.sql and change the /*!40101 SET NAMES latin1 */; by /*!40101 SET NAMES utf8mb4 */;

  • Import the database

sudo mariadb --default-character-set=utf8mb4_0900_ai_ci database < database.sql

Remplace mariadb by mysql for MySQL

Note

utf8mb4_0900_ai_ci is the new default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment