<i id='rsv6x'><div id='rsv6x'><ins id='rsv6x'></ins></div></i>

<code id='rsv6x'><strong id='rsv6x'></strong></code>
  • <ins id='rsv6x'></ins>

  • <tr id='rsv6x'><strong id='rsv6x'></strong><small id='rsv6x'></small><button id='rsv6x'></button><li id='rsv6x'><noscript id='rsv6x'><big id='rsv6x'></big><dt id='rsv6x'></dt></noscript></li></tr><ol id='rsv6x'><table id='rsv6x'><blockquote id='rsv6x'><tbody id='rsv6x'></tbody></blockquote></table></ol><u id='rsv6x'></u><kbd id='rsv6x'><kbd id='rsv6x'></kbd></kbd>
  • <span id='rsv6x'></span>

    <acronym id='rsv6x'><em id='rsv6x'></em><td id='rsv6x'><div id='rsv6x'></div></td></acronym><address id='rsv6x'><big id='rsv6x'><big id='rsv6x'></big><legend id='rsv6x'></legend></big></address>
          <fieldset id='rsv6x'></fieldset><dl id='rsv6x'></dl>

        1. <i id='rsv6x'></i>

            Linux中如何设置MySQL的服务器字符集

            • 时间:
            • 浏览:15
            • 来源:124软件资讯网

              启动mysql后 ,以root登录mysql isher@isher-ubuntu:~$ mysql -u root

              >show variables like '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 | /usr/share/mysql/charsets/ |
              +--------------------------+----------------------------+

              在某些时间  ,我们续要修改mysql默认数据库的编码  ,以保证某些迁徙的法式可以正常显示  ,编辑my.cnf文件举行编码修改,windows可以直接用Mysql Server Instance Config Wizard 举行设置

              在linux下修改3个my.cnf的1个/etc/mysql/my.cnf文件

              找到客户端设置[client] 在下面添加

              default-character-set=utf8 默认字符集为utf8

              在找到[mysqld] 添加

              default-character-set=utf8 默认字符集为utf8

              init_connect='SET NAMES utf8' (设定毗连mysql数据库时使用utf8编码 ,以让mysql数据库为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 |
              | character_sets_dir | /usr/share/mysql/charsets/ |
              +--------------------------+----------------------------+

              此要领用于尺度mysql版本同样有用  ,对于/etc/my.cnf文件  ,需要从mysql/support-files的文件夹cp my-large.cnf一份到/etc/my.cnf

              对于Ubuntu的用户  ,若是是使用 Synaptic 安装的  ,则直接在 /etc/mysql/my.cnf