MySQL convert latin1 to utf-8
1. Backup database
mysqldump -h mydomain -u root -p --default-character-set=latin1 database > database.sql
2. In phpMyadmin, change MySQL charset as UTF-8 Unicode (utf8)
3. In phpMyadmin, change MySQL MySQL connection collation as utf8_general_ci
4. edit database.sql, replace "DEFAULT CHARSET=latin1" to "DEFAULT CHARSET=utf8"
5. Import database.sql
mysql -u root -p new_database < database.sql
mysqldump -h mydomain -u root -p --default-character-set=latin1 database > database.sql
2. In phpMyadmin, change MySQL charset as UTF-8 Unicode (utf8)
3. In phpMyadmin, change MySQL MySQL connection collation as utf8_general_ci
4. edit database.sql, replace "DEFAULT CHARSET=latin1" to "DEFAULT CHARSET=utf8"
5. Import database.sql
mysql -u root -p new_database < database.sql
Comments
Post a Comment