yablokoff
yablokoff

Reputation: 165

MySQL 5.5 utf8 trouble

I've done all the things that worked on previous versions of MySQL (and new to MySQL 5.5) to set utf8 encoding. Now I have output of

SHOW GLOBAL VARIABLES LIKE '%char%';

exactly what I wanted:

+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+

And that cmds in [mysqld]:

collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8

In [client] and [mysql]:

default-character-set= utf8

But default table encoding in creating is still latin1! Am I missed some other things with MySQL 5.5 to make it work?

Thanks in advance!

Upvotes: 0

Views: 801

Answers (1)

zerkms
zerkms

Reputation: 255115

Default table encoding equals to the current database encoding.

You can check it with

SHOW CREATE DATABASE dbname;

PS: it's a good practice to always specify encoding explicitly. That way you won't rely on server settings.

Upvotes: 3

Related Questions