MySQL字符集
2008-09-05 11:08:06 来源:WEB开发网2.查看默认字符集(默认情况下,mysql的字符集是latin1(ISO_8859_1)
通常,查看系统的字符集和排序方式的设定可以通过下面的两条命令:
mysql>SHOWVARIABLESLIKE'character%';
+--------------------------+---------------------------------+
|Variable_name|Value|
+--------------------------+---------------------------------+
|character_set_client|latin1|
|character_set_connection|latin1|
|character_set_database|latin1|
|character_set_filesystem|binary|
|character_set_results|latin1|
|character_set_server|latin1|
|character_set_system|utf8|
|character_sets_dir|D:"mysql-5.0.37"share"charsets"|
+--------------------------+---------------------------------+
mysql>SHOWVARIABLESLIKE'collation_%';
+----------------------+-----------------+
|Variable_name|Value|
+----------------------+-----------------+
|collation_connection|utf8_general_ci|
|collation_database|utf8_general_ci|
|collation_server|utf8_general_ci|
+----------------------+-----------------+
3.修改默认字符集
(1) 最简单的修改方法,就是修改mysql的my.ini文件中的字符集键值,
如 default-character-set = utf8
character_set_server=utf8
修改完后,重启mysql的服务,service mysql restart
更多精彩
赞助商链接