發文作者:marky0511 | 五月 16, 2007

如何改變 mysql 資料庫 編碼

將資料庫改編碼
先查編碼種類
mysql> show character set;

再用以下語法修改
ALTER DATABASE `<dbname>` DEFAULT CHARACTER SET <charset> COLLATE <collation>;

比如我要把 markyton 這個資料庫改為utf-8 編碼,指令如下:
mysql> alter database `markyton` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 1 row affected (0.42 sec)


發表迴響

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

連結到 %s

分類

Follow

Get every new post delivered to your Inbox.