Friday, June 09, 2006

Migrate from mysql 4.0.x to mysql 4.1.x - use utf8

my.cnf
[client]
port = 3306
character-sets-dir=/usr/share/mysql/charsets/
default-character-set=utf8


# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306

#init_connect='SET collation_connection = utf8_general_ci'
#init_connect='SET NAMES utf8'
default-character-set=utf8
character-set-server=latin1
#collation-server = utf8_general_ci

[mysql]
default-character-set=utf8


mysqldump --user=username --password=password --default_character-set=latin1 --skip-set-charset dbname > dump.sql
chgrep latin1 utf8 dump.sql
mysql --user=username --password=password --execute="DROP DATABASE dbname; CREATE DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci;"
mysql --user=username --password=password --default-character-set=utf8 dbname < dump.sql

0 Comments:

Post a Comment

<< Home