Moving from Latin1 to utf8
Posted by: Erin ONeill
Date: May 25, 2006 09:51AM

I heard all about how character sets could bite you in mysql/php at the MySQL conference & now I'm experiencing it first hand!

We're using MySQL 4.1.18 & php 5.0.4 in Apache 2.

We'd like to move to utf8. The databases and tables have been converted to utf8. The server has this in the my.cnf file:

default-character-set=utf8
character_set_server = utf8
collation_server = utf8_general_ci

When I log onto the server (command line in linux) and see what the charsets/collation are set to I see this:

mysql> show variables like "char%";
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | utf8 |
| character_set_results | latin1 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
7 rows in set (0.00 sec)

mysql> show variables like "col%";
+----------------------+-------------------+
| Variable_name | Value |
+----------------------+-------------------+
| collation_connection | latin1_swedish_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
+----------------------+-------------------+
3 rows in set (0.00 sec)

And when I do queries using fulltext indexes I get collation errors!

I've tried to set all of these in the my.cnf file but then could not log in with mysql or the server failed to come up.

Is the only way to set these done in the php.ini or the apache httpd.conf/.htaccess files? And is setting the default charset in php.ini good enough? what else will it break??

thanks.
erin

Options: ReplyQuote


Subject
Views
Written By
Posted
Moving from Latin1 to utf8
3057
May 25, 2006 09:51AM
1787
January 09, 2007 05:36AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.