Hi
I'm trying to tell my mysql database to use UTF8 as character set, this seems trivial but I can't get it to work. My special characters are maimed in the database. I played around with the configuration file my.cnf, it does have effect on some system variables but didn't result in a working solution.
As the trial and error approach is not working for me, I would like to have some conclusive information on how to do this with MySQL.
Did change some the variables but characters are still maimed.
[mysqld]
character-set-server = utf8
default-character-set = utf8
MySQL failed to start on the following
[mysqld]
character-set-server = utf8
default-character-set = utf8
character-set-client = utf8
character-set-connection = utf8
Failed to start
[mysqld]
character-set-server = utf8
default-character-set = utf8
collation_connection = utf8
MySQL starts but no effect
[mysqld]
init-connect='SET NAMES utf8'
MySQL start but no effect
init-connect='CHARSET utf8'
mysql> show variables like 'colla%';
+----------------------+--
----------
-------+
| Variable_name | Value |
+----------------------+--
----------
-------+
| collation_connection | latin1_swedish_ci |
| collation_database | latin1_swedish_ci |
| collation_server | latin1_swedish_ci |
+----------------------+--
----------
-------+
3 rows in set (0.00 sec)
mysql> show variables like 'charact%';
+-------------------------
-+--------
----------
----------
+
| Variable_name | Value |
+-------------------------
-+--------
----------
----------
+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/
|
+-------------------------
-+--------
----------
----------
+
8 rows in set (0.00 sec)
Start Free Trial