Mediawiki 1.5.6 latin1 -> utf8 convert problem : I can't put my utf8 db into mysql.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Mediawiki 1.5.6 latin1 -> utf8 convert problem : I can't put my utf8 db into mysql.

Kim Jihun
I use mediawiki 1.5.6. (RHEL4 mediawiki-1.5.6-15.el4.at.i386.rpm package)
I convert my wikidb latin1 to utf8. But I cannot put it into mysql.
$mysql -p wikidb < utf8.sql
Enter password:
ERROR 1071 (42000) at line 1474: Specified key was too long; max key
length is 1000 bytes

I found similar post,
http://mail.wikimedia.org/pipermail/mediawiki-l/2005-August/006196.html
But it does`t help.

detail :

I use CentOS 4.2 + MySQL 4.1.12 + php 4.3.9 + Apache 2.0.52.
I upgrade mediawiki 1.4.10 -> 1.5.6. I use 'backward compatible utf8'.
It work fine. But it use latin1.
My wiki homepage looks like 'utf8' but MySQL DB use latin1 :

mysql>use wikidb;
mysql>show variables like 'c%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | latin1                     |
| character_set_connection | latin1                     |
| character_set_database   | latin1                     |
| character_set_results    | latin1                     |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
| collation_connection     | latin1_swedish_ci          |
| collation_database       | latin1_swedish_ci          |
| collation_server         | latin1_swedish_ci          |
| concurrent_insert        | ON                         |
| connect_timeout          | 5                          |
+--------------------------+----------------------------+

I convert it to utf8.
mysqldump --default-character-set=latin1 --add-drop-table
--complete-insert -p wikidb > foo.sql
vi foo.sql
:%s/CHARSET=latin1/CHARSET=utf8/g
:%s/latin1_bin/utf8_bin/g
:%s/latin1/utf8/g
So foo.sql is utf8 file.(i.e. in file editor, I choose file encoding =
utf8, it look well.)

I change /etc/my.cnf so mysql use utf8. And restart mysqld, create new db.
mysql>DROP DATABASE wikidb;
mysql>CREATE DATABASE jihuni DEFAULT CHARACTER SET utf8;
mysql>show variables like 'c%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
| collation_connection     | utf8_general_ci            |
| collation_database       | utf8_general_ci            |
| collation_server         | utf8_general_ci            |
| concurrent_insert        | ON                         |
| connect_timeout          | 5                          |
+--------------------------+----------------------------+

But I can not put it into mysql.
$mysql -p wikidb < utf8.sql
Enter password:
ERROR 1071 (42000) at line 1474: Specified key was too long; max key
length is 1000 bytes

I also test it using Fedora Core 4+ MySQL 5.0.18 machine, but it doesn`t
work, too.
$mysql -p wikidb < utf8.sql
Enter password:
ERROR 1071 (42000) at line 1474: Specified key was too long; max key
length is 1000 bytes
_______________________________________________
Wikitech-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/wikitech-l