Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set MySQL database to support multi language?

Status
Not open for further replies.

lamborghini

IS-IT--Management
Jun 5, 2003
4
CA
Hi there,

I am trying create a database and some tables, it is required to support multi-language in the table, i.e. Chinese and english, I tried the following way, but it has error, could you please share your ideas with me?

*********************************************************
CREATE DATABASE IF NOT EXISTS user DEFAULT CHARACTER SET gb2312 COLLATE gb2312_chinese_ci;

use user;

DROP TABLE IF EXISTS password;


CREATE TABLE password (
customerid CHAR(20) NOT NULL,
password CHAR(50) UNICODE,
role CHAR(10) DEFAULT 'customer',
PRIMARY KEY (customerid)
);

No problem to create db and table, but if has the following error when I type in some Chinese character.

ERROR 1266: Illegal mix of collations (gb2312_chinese_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '='
 
Thank you very much. I tried it, it is better. But, after I input chinese characters, and select * from password;

It becomes as question marks. I doubt I need do sth on Server side.

Your any ideas will be appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top