首页 > 数据库技术 > 详细

MYSQL 修改字符集

时间:2016-08-08 19:41:00      阅读:233      评论:0      收藏:0      [点我收藏+]

1.暂时修改
 set names utf8
2.永久修改
 mysqld下加
 character_set_server = utf8

 MariaDB [(none)]> show variables like ‘%char%‘;
 +--------------------------+-------------------------------------------------------+
 | Variable_name            | Value                                                 |
 +--------------------------+-------------------------------------------------------+
 | character_set_client     | latin1                                                |
 | character_set_connection | latin1                                                |
 | character_set_database   | utf8                                                  |
 | character_set_filesystem | binary                                                |
 | character_set_results    | latin1                                                |
 | character_set_server     | utf8                                                  |
 | character_set_system     | utf8                                                  |
 | character_sets_dir       | /var/soft/mariadb-5.5.50-linux-x86_64/share/charsets/ |
 +--------------------------+-------------------------------------------------------+

 client和mysql下加
 default-character-set = utf8
 MariaDB [(none)]> show variables like ‘%char%‘;
 +--------------------------+-------------------------------------------------------+
 | Variable_name            | Value                                                 |
 +--------------------------+-------------------------------------------------------+
 | character_set_client     | latin1                                                |
 | character_set_connection | latin1                                                |
 | character_set_database   | utf8                                                  |
 | character_set_filesystem | binary                                                |
 | character_set_results    | latin1                                                |
 | character_set_server     | utf8                                                  |
 | character_set_system     | utf8                                                  |
 | character_sets_dir       | /var/soft/mariadb-5.5.50-linux-x86_64/share/charsets/ |
 +--------------------------+-------------------------------------------------------+

 需要在mysqld下加上
 skip-character-set-client-handshake
 MariaDB [(none)]> show variables like ‘%char%‘;
 +--------------------------+-------------------------------------------------------+
 | 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                                                  |
 | character_sets_dir       | /var/soft/mariadb-5.5.50-linux-x86_64/share/charsets/ |

 

MYSQL 修改字符集

原文:http://120662.blog.51cto.com/110662/1835693

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!