How to set character_set_database and collation_database to utf8 in my.ini?

This actually isn’t a setting in the my.cnf (or my.ini in this case). mySQL gets this setting from the database’s own collation (when it was created). Inorder to get this inline with the utf8 encoding you want, do this:

ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_general_ci;

then do a restart on mysql (cant remember if its needed though), followed by a:

SHOW VARIABLES;

All should be well,
Hope that helps!


side note: i think default-character-set is deprecated now-a-days (mySQL 5.5+) and seems to make the config file fidgety.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)