Home > Database > Mysql Tutorial > mysql的utf8设置_MySQL

mysql的utf8设置_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:35:05
Original
943 people have browsed it

bitsCN.com

mysql的utf8设置

 

    为了支持汉字以及统一字符集,所以我们使用utf8字符集。

   首先,我们修改my.ini(mysql配置文件),在如下配置块增加如下内容:

 

        1.      [client] # 与mysql连接的客户端(其中包括我们编写的应用程序)

                 default-character-set = utf8

       2.      [mysqld] # 服务器相关设置

                character_set_server= utf8                # 兼容V5.5设置

                default-collation= utf8_general_ci

    

    然后,我们使用命令查看我们的设置是否正确:

      1. 查看字符集

 

mysql的utf8设置_MySQL

 

    2. 查看排序规则

 

mysql的utf8设置_MySQL

 

    3. 如果在cmd(或终端)执行表查询(表内数据有中文数据)

    mysql> set character_set_results = gbk;
 

bitsCN.com
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template