From: Spiros Philopoulos Sent: 06 July 2006 13:32
> 
> Hi. I just installed MySQL 4.1.20 for the UTF-8 support it 
> offers. I'm 
> trying to set the charcter set & collation at the database level but 
> can't get it to work.
> 
> It works by setting it at the server level (in my.cnf) but I want to 
> set it at the database level because I'll be hosting the web app on a 
> third-party web hosting server, where likely I won't have access to 
> server level settings via my.cnf (is there a way around this?).
> 
> I perform the following query:
> 
> ALTER DATABASE <my schema name> DEFAULT CHARACTER SET utf8 COLLATE 
> utf8_general_ci;
> 
> After the query a dump of the relevant MySQL variables is as follows:
> character_set_client: utf8
> character_set_connection: utf8
> character_set_database: utf8
> character_set_results: utf8
> character_set_server: latin1
> character_set_system: utf8
> collation_connection: utf8_general_ci
> collation_database: utf8_general_ci
> collation_server: latin1_swedish_ci
> 
> 
> The variables look right but the characters (chinese in this case) do 
> not display correctly in the web page. As mentioned before 
> setting the 
> charset at server level results in the characters displaying 
> just fine.
> 
> Any thoughts/guesses?

The ALTER above only sets the character set for any future tables
created, it won't convert any data already in tables. If you recreate
the tables and data after setting the database char set, does it work?
You can use 'SHOW CREATE <table_name>' to check what character set the
tables are actually using.

If you need to convert existing data see:
http://dev.mysql.com/doc/refman/4.1/en/charset-conversion.html

Mind you not sure how that fits with it working with the database
char set set to utf8!

hth,
mark
--
 





MARK ADDISON
WEB DEVELOPER

200 GRAY'S INN ROAD
LONDON
WC1X 8XZ
UNITED KINGDOM
T +44 (0)20 7430 4678
F 
E [EMAIL PROTECTED]
WWW.ITN.CO.UK
Please Note:

 

Any views or opinions are solely those of the author and do not necessarily 
represent 
those of Independent Television News Limited unless specifically stated. 
This email and any files attached are confidential and intended solely for the 
use of the individual
or entity to which they are addressed. 
If you have received this email in error, please notify [EMAIL PROTECTED] 

Please note that to ensure regulatory compliance and for the protection of our 
clients and business,
we may monitor and read messages sent to and from our systems.

Thank You.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to