1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

MySQL Character Set and Collation

Discussion in 'Plesk for Linux - 8.x and Older' started by postman, Dec 26, 2007.

  1. postman

    postman Guest

    I am 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".
    I am able to solve this by converting the utf8_general_ci to latin1_swedish_ci and then doing the import again.
    However, I would like Plesk to default to creating the databases as latin1_swedish_ci but I don't know where to do this? Can anyone help with that?
    Thanks in advance,
  2. Hedgren

    Hedgren Guest

    Hi: the default MySQL character should be set as 'latin1'. Should also be the same in /etc/my.cnf. There are some relevant notes in http://kb.swsoft.com/en/2112, /Regards.
  3. Hedgren

    Hedgren Guest

    Also try out commenting (or removing) the option '--compatible=mysql323' from all lines where it is found in the file: /usr/local/psa/PMM/agents/shared/Db/MysqlShellBackend.pm
    and re-run the doman migration in Migration Manager from Plesk control panel. There are high chances this prob has been fixed in Plesk 8.3's migration manager (PMM).
  4. M:ke

    M:ke Guest

    Dear users.

    Default MySQL character set is on both server the same: latin1. Im using Plesk 8.3.0.
    But the PMM creates new databases as utf-8, not latin1. I got the same max key length message:
    When I create the database manually (by using the mysql-client) all goes fine.

    Edit: I grepped utf8 in the PMM agents:
    Seems to be hardcoded. Or anavailable to set up in Plesk configuration frontend. I try to fix my problem by changing the $dumpoptions-variable.

    Edit: No, I try nothing yet. Because this "problem" still exist when I create a database in the Plesk frontend. Database is UTF8. See:
  5. M:ke

    M:ke Guest

    Does not work.
    I need a solution, cause I cant migrate all databases by myself.
  6. benji

    benji Guest


    I simply removed the <<<--default-charset=utf8>>> parameter, on that file (/usr/local/psa/PMM/agents/shared/Db/MysqlShellBackend.pm), and now migration manager is working just perfect. Hope that helps anyone.