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

How Can I Alter The Charset Of A Db Or Table?

forums forums SQLyog Using SQLyog How Can I Alter The Charset Of A Db Or Table?

  • This topic is empty.
Viewing 3 reply threads
  • Author
    Posts
    • #10089
      BusterK
      Member

      Hello, I can't find a way to alter the charset. I use cp850 for portuguese and with latin1 it just changes the characters to ?. For instance I use “ç”, “á”, “ã”, etc.

    • #23107
      peterlaursen
      Participant

      We do not yet provide such option from the GUI.

      You can use SQL like 

      “CREATE DATABASE DEFAULT CHARSET cp850”

      “CREATE/ALTER TABLE tablename DEFAULT CHARSET cp850”

      (and the charset for the databae and/or table will be different from the server default.

      You can change the server defa

      But two things you should note:

      1)  This will only have effect on NEW databases and tables.

      2)  After that when connecting with SQLyog choose 'cp850' for the connection and not '

      default'  

    • #23108
      BusterK
      Member
      peterlaursen wrote on Dec 20 2006, 05:32 AM:
      We do not yet provide such option from the GUI.

      You can use SQL like 

      “CREATE DATABASE DEFAULT CHARSET cp850”

      “CREATE/ALTER TABLE tablename DEFAULT CHARSET cp850”

      (and the charset for the databae and/or table will be different from the server default.

      You can change the server defa

      But two things you should note:

      1)  This will only have effect on NEW databases and tables.

      2)  After that when connecting with SQLyog choose 'cp850' for the connection and not '

      default'  

      Many thanks peterlaursen.

      But you were saying “You can change the server defa…”, is it how to change the server default charset?

      Please explain me that.

    • #23109
      peterlaursen
      Participant

      if you “ALTER TABLE … DEFAULT CHARSET ..” the byte sequence of what is stored is not changed,  And any character that is encoded differently in the two charsets will garble.

      All charset setting only take effect with NEW data!

      An example: those accented latin characters are stored using two bytes in UTF8, but only one

      byte in LATIN*.  

      If you have some data stored as UFT8 and “ALTER TABLE … DEFAULT CHARSET ..” every such character will become two (weird) characters!

      You can export data to a .sql file, edit this file (and change the server default if you like) and import!

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