码迷,mamicode.com
首页 > 数据库 > 详细

mysql数据库默认编码配置

时间:2016-01-02 22:32:50      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:

修改my.ini文件

以下添加
[mysql] 
default-character-set=utf8
[mysqld]

character_set_server = utf8
init_connect=‘SET NAMES utf8‘


修改完毕后重新启动后,查看下面的参数。

mysql> show variables like ‘character%‘;
+--------------------------+----------------------------------------+
| Variable_name | Value |
+--------------------------+----------------------------------------+

character_set_client utf8
character_set_connection utf8
character_set_database utf8
character_set_filesystem binary
character_set_results utf8
character_set_server utf8
character_set_system utf8


8 rows in set (0.01 sec)

mysql> show variables like ‘coll%‘;
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
+----------------------+-----------------+
3 rows in set (0.00 sec)

mysql数据库默认编码配置

标签:

原文地址:http://www.cnblogs.com/tumio/p/5095343.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!