forums › forums › SQLyog › Using SQLyog › How Can I Alter The Charset Of A Db Or Table?
- This topic is empty.
-
AuthorPosts
-
-
December 19, 2006 at 4:44 pm #10089BusterKMember
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.
-
December 20, 2006 at 5:32 am #23107peterlaursenParticipant
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'
-
January 22, 2007 at 4:06 pm #23108BusterKMemberpeterlaursen 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.
-
January 23, 2007 at 5:07 am #23109peterlaursenParticipant
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!
-
-
AuthorPosts
- You must be logged in to reply to this topic.