How to alter MySQL Charset
Posted by: ojoj (202.181.238.---)
Date: June 24, 2006 06:53AM

After I installed WAMP on my window machine, I found that the MySQL charset is set to UTF-8 Unicode. How to alter the server charset to Big5?

Thak you very much.

Options: ReplyQuote
Re: How to alter MySQL Charset
Posted by: CyberSpatium (67.170.181.---)
Date: June 24, 2006 04:12PM

MySQL released a function called mysql_set_character_set() in version 5.0.7. However, php did not support that extension until php 5.1. But it is only supported with the MySQLi extension, not MySQL.
mysqli_set_charset()
[us2.php.net]

when you create your databases, you can set whatever character set you want. this works with php4 and php5, as well as MySQL and MySQLi:

CREATE DATABASE db_name
CHARACTER SET charset_name


You can also alter any database to change its character set:

ALTER DATABASE db_name
CHARACTER SET charset_name


[dev.mysql.com]

If you downloaded the WAMP MySQL administration toolkit add-on, you can open that up and edit your MySQL server settings and change your default character set.

If you comfortable editing config files, you can edit your MySQL my.ini conf file. Find this line:
default-character-set=latin1

change it to:
default-character-set=UTF-8

After you edit this file you need to restart all WAMP services for the new settings to take effect.



Post Edited (06-26-06 08:05)

CyberSpatium
----------------------
WAMP Forum Admin

Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.

Options: ReplyQuote
Re: How to alter MySQL Charset
Posted by: ojoj (202.181.238.---)
Date: June 26, 2006 03:42AM

I got it, thank you very much

Options: ReplyQuote


Sorry, only registered users may post in this forum.