Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Convert To Unicode

forums forums SQLyog Using SQLyog Convert To Unicode

  • This topic is empty.
Viewing 3 reply threads
  • Author
    Posts
    • #10416
      Alan Sawyer
      Member

      I have been given the task of converting 5 MYSQL databases to unicode.

      I have not done this before.

      Is there an easy way to do this by exporting and importing or something like that.

      Any help would be appreciated.

      Alan

    • #24392
      peterlaursen
      Participant

      1) yes you can simple export with SQLyog, and open the file in a text editor and change 'create database …' to 'create database … charset utf8 [collate ….]' and import again.  Now the database will be created with the specified charset and not the server default charset.  Be sure that there is no different CHARSET definition in the CREATE TABLE statements (just delete 'DEFAULT CHARSET …' for every table and tables will be created with database default

      2) you can also use  ALTER TABLE for every table.

      first ALTER TABLE … charset utf8 (changes the table default)

      next change the charset/collation for every column in SQLyog ALTER TABLE dialogue (this will re-encode existing data)

      .. but teh default charset for the database will still be the old one.  So whenever you want to create a unicode table the charset must be specified explicitly.

      You may also want to change the server default from a non-unicode charset to utf8. This you do by editing my.ini/my.cnf

    • #24393
      peterlaursen
      Participant

      1) yes you can simple export with SQLyog, and open the file in a text editor and change 'create database …' to 'create database … charset utf8 [collate ….]' and import again.  Now the database will be created with the specified charset and not the server default charset.  Be sure that there is no different CHARSET definition in the CREATE TABLE statements (just delete 'DEFAULT CHARSET …' for every table and tables will be created with database default

      2) you can also use  ALTER TABLE for every table.

      first ALTER TABLE … charset utf8 (changes the table default)

      next change the charset/collation for every column in SQLyog ALTER TABLE dialogue (this will re-encode existing data)

      .. but teh default charset for the database will still be the old one.  So whenever you want to create a unicode table the charset must be specified explicitly.

      You may also want to change the server default from a non-unicode charset to utf8. This you do by editing my.ini/my.cnf

    • #24394
      Alan Sawyer
      Member

      Thanks for the information. I will try it out.

      Alan

Viewing 3 reply threads
  • You must be logged in to reply to this topic.