Possible Duplicate:
UTF-8 all the way through
I am having some difficulty changing everything in a database to be utf8.
Here is what I currently have:
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
| collation_connection | utf8_general_ci |
| collation_database | latin1_swedish_ci |
| collation_server | latin1_swedish_ci |
+--------------------------+----------------------------+
I have a /etc/my.cnf
file with the following contents:
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
init_connect=’SET collation_connection = utf8_general_ci’
init_connect=’SET NAMES utf8′
default-character-set=utf8
character-set-server=utf8
collation-server=utf8_general_ci
skip-character-set-client-handshake
When I do $ sudo service mysql restart
to 'load' the files, nothing happens. How can I get everything utf8
here?
mysql> show variables like '%init_file%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| init_file | |
+---------------+-------+
show variables like '%init_file%'
to confirm that there's no other .ini/.cnf file being loaded that could be overriding your changes. – Marc B Dec 4 '12 at 20:53init_connect=’SET
.’
is not the same as'
. Don't know if mysql cares, but you may want to check on that. – Marc B Dec 4 '12 at 20:58my.cnf
file (i.e., doing a search for 'my.cnf' in the file gives 0 results). – David542 Dec 4 '12 at 23:08