MySQL Collation and Character Set

Importing databases from MySQL 3.2 to MySQL 5 – When I create a
database using Plesk it creates it as utf8 (Character Set) and
utf8_general_ci(Collation) but when I create a database using
PhpMyAdmin the database is created as latin1 (Character Set) and
latin1_swedish_ci(Collation). The trouble comes when I import sql files
into the utf8 database. I get an error "Specified key was too long; max
key length is 1000 bytes" especially when importing the SQL of a Joomla installation.
I am able to solve this by converting the utf8_general_ci to latin1_swedish_ci and then doing the import again.

ALTER DATABASE `myDB` CHARACTER SET latin1 COLLATE latin1_swedish_ci;

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>