Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a table that stores string from a user and is displayed in a web form. But as I see when the user inputs e.g. in a language of cyrilic alphabet (I assume is UTF-8) garbage are displayed back. I did a show create table and I saw that the table is defined as LATIN-1 and the column that stores the string is defined as TEXT. I am not clear on what type of data does TEXT stores. Is it only for ASCII? Should I be using a different data type? Which would be the most appropriate?

share|improve this question
add comment

1 Answer 1

You'll have to specify a character set of UTF8 on the table schema. See http://dev.mysql.com/doc/refman/5.5/en/charset-syntax.html

Depending on your needs you can specify table defaults which then apply to all unspecified text columns (char/varchar/text) or you can specify on a per column level.

You'll also need to have your applications to specify a UTF-8 character encoding. The specifics on how to do this will depend on the language you are using.

share|improve this answer
    
And the applicaton's client connection to the server needs to be correctly configured to support utf8. –  Michael - sqlbot Oct 9 '13 at 4:27
    
So how could i alter the text column to support UTF-8? Does it now support only LATIN-1? Also how could I alter the table so that it supports UTF-8? Also if I do such an alter are the existing data corrupted? –  Jim Oct 9 '13 at 6:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.