win7 64位,mysql5.6 字符集修改问题mysql5.6是官网下载安装版的
安装后 C:\ProgramData\MySQL\MySQL Server 5.6\
路径下有个my.ini文件
这个配置文件是否放在这里还是安装路径 C:\Program Files\MySQL\MySQL Server 5.6\ 下呢?我在安装路径 C:\Program Files\MySQL\MySQL Server 5.6\ 下放了个my.ini文件
修改字符集latin1 重启服务但控制台下显示仍然是utf8字符集???
mysql> 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       | C:\Program Files\MySQL\MySQL Server 5.6\share\chars
ets\ |
+--------------------------+----------------------------------------------------
-----+
8 rows in set (0.00 sec)
下面拷了2个my.ini配置文件里的设置:(部分)1:
C:\ProgramData\MySQL\MySQL Server 5.6\my.ini# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If you want your own MySQL client program to
# honor these values, you need to specify it as an option during the
# MySQL client library initialization.
#
[client]
no-beep# pipe
# socket=mysql
port=3306[mysql]default-character-set=utf8
# SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this 
# file.
#
# server_type=3
[mysqld]# The next three options are mutually exclusive to SERVER_PORT below.
# skip-networking
# enable-named-pipe
# The Pipe the MySQL Server will use
# socket=mysql# The TCP/IP Port the MySQL Server will listen on
port=3306# Path to installation directory. All paths are usually resolved relative to this.
# basedir="C:/Program Files/MySQL/MySQL Server 5.6/"# Path to the database root
datadir="C:/ProgramData/MySQL/MySQL Server 5.6/data\"# The default character set that will be used when a new schema or table is
# created and no character set is defined
character-set-server=utf8# The default storage engine that will be used when create new tables when
default-storage-engine=INNODB# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"# Enable Windows Authentication
# plugin-load=authentication_windows.dll..............................2:
C:\Program Files\MySQL\MySQL Server 5.6\my.ini# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If you want your own MySQL client program to
# honor these values, you need to specify it as an option during the
# MySQL client library initialization.
#
[client]
#password =1234 # pipe
# socket=mysql
port=3306default-character-set=latin1[mysql]
port=3306default-character-set=latin1# SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this 
# file.
#
# server_type=3
[mysqld]# The next three options are mutually exclusive to SERVER_PORT below.
# skip-networking
# enable-named-pipe
# The Pipe the MySQL Server will use
# socket=mysql# The TCP/IP Port the MySQL Server will listen on
port=3306# Path to installation directory. All paths are usually resolved relative to this.
basedir="C:\Program Files\MySQL\MySQL Server 5.6\"# Path to the database root
datadir="C:\ProgramData\MySQL\MySQL Server 5.6\Data\"# The default character set that will be used when a new schema or table is
# created and no character set is defined
character-set-server=latin1# The default storage engine that will be used when create new tables when
default-storage-engine=INNODB# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"# Enable Windows Authentication
# plugin-load=authentication_windows.dll哪位童鞋能帮忙解释下,先谢了!

解决方案 »

  1.   

    补充下,现在服务是
    2个路径下都有my.ini 配置看楼上贴的
      

  2.   

    1)
    mysql 5.6 command line client 控制台下(安装后带的)mysql> 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       | C:\Program Files\MySQL\MySQL Server 5.6\share\chars
    ets\ |
    +--------------------------+----------------------------------------------------
    -----+
    8 rows in set (0.00 sec)
    2)
    cmd.exe 控制台下
    cd C:\Program Files\MySQL\MySQL Server 5.6\bin\
    登陆再看
    mysql> 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       | C:\Program Files\MySQL\MySQL Server 5.6\share\chars
    ets\ |
    +--------------------------+----------------------------------------------------
    -----+
    8 rows in set (0.00 sec)
      

  3.   

    帮你丢到mysql了