rhel4 mysql5.5 字符集_character set

wisdomone1發表於2010-06-18
 
和oracle字符集一樣,有些暈,太細了
 
小結:
1,字符集分為:伺服器,資料庫,表,連線,列等
    對應引數為:
mysql> show variables like 'chara%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | latin1                     |
| character_set_connection | latin1                     |
| character_set_database   | gb2312                     |
| character_set_filesystem | binary                     |
| character_set_results    | latin1                     |
| character_set_server     | gb2312                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
mysql> show variables like 'collation%';#類似於oracle show parameter呵呵
+----------------------+-------------------+
| Variable_name        | Value             |
+----------------------+-------------------+
| collation_connection | latin1_swedish_ci |
| collation_database   | gb2312_chinese_ci |
| collation_server     | gb2312_chinese_ci |
+----------------------+-------------------+
3 rows in set (0.00 sec)
mysql>
 
 
2,建立或修改字符集
    create dababase zxy character set gb2312;
    
    alter database zxy character set gb2312;
 
    set character_set_server=latin;
 
    啟動mysqld指定default_character_set引數
 
    配置/etc/my.cnf中的client及server節關於default_character_set引數
  

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-665625/,如需轉載,請註明出處,否則將追究法律責任。

相關文章