How to set MySQL default charset in Windows XAMP

MySQL has the latin1_swedish_ci as default charset but I need to set utf-8.

Append the following lines to the end of my.ini:

[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci

Now you have to restart the MySQL server to apply changes.

Senior Full-Stack Software Engineer and Instructor

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store