Hacker News new | ask | show | jobs
by happenstance 5984 days ago
Why does MySQL still default to latin1? (Or am I mistaken?)
2 comments

Just run:

ALTER DATABASE database_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

And you don't have to worry about it for any new tables. (If you have existing ones, you'll have to change the table default, and possibly the column too.)

Because changing the defaults might mean a world of hurt for people not expecting it. You should just always be explicit.
> You should just always be explicit.

I generally agree.

Note: I think if you leave out any specific encoding configuration from your my.cnf, mysql implicitly goes with latin1.

For users who are assuming a modern unicode/utf8 default setup, might be nice if the mysql folks would require an explicit config for this setting.