tags:

views:

44

answers:

4

Hello,

How do i store unicode in free edition of MySql? There doesn't seem to be nvarchar type as in Sql Server. Is unicode not supported in MySql? I tried using text but that too is not working.

Thanks in advance:)

+1  A: 

Have you tried setting names after connection? What was the outcome of tryng to store unicode characters? Connect to mysql server and type this:

SET NAMES UTF8;

This should turn on "support" for utf8. Then try storing utf data.

Eimantas
+1  A: 
  • MySQL supports UTF-8.
  • Use varchar and set encoding for the column (it's quite easy in phpMyAdmin)

http://www.oreillynet.com/onlamp/blog/2006/01/turning_mysql_data_in_latin1_t.html - I think this could help you

MartyIX
+2  A: 

You need to choose a utf8_* character set for your table. Text and memo fields will then automatically be stored in UTF-8. Support for UTF-16 is coming in mySQL 6.

Pekka
+1  A: 

The character set for a given string column (CHAR, VARCHAR or *TEXT) is determined by its character set and/or collation. This is a quite intense topic so it's best to read the documentation I linked. For example:

CREATE TABLE t1
(
    col1 CHAR(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci
)

will create a table t1 with a col1 that stores its content in UTF-8 encoding.

Stefan Gehrig