win7 64位,mysql5.6 字符集修改问题

huangys1022 2013-09-15 10:19:02
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=3306

default-character-set=latin1

[mysql]
port=3306

default-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

哪位童鞋能帮忙解释下,先谢了!
...全文
749 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
發糞塗牆 2013-09-17
  • 打赏
  • 举报
回复
帮你丢到mysql了
huangys1022 2013-09-17
  • 打赏
  • 举报
回复
发错地方了么
huangys1022 2013-09-17
  • 打赏
  • 举报
回复
没有童鞋能解释下吗!?!?
Rotel-刘志东 2013-09-15
  • 打赏
  • 举报
回复
支持一下!!!
huangys1022 2013-09-15
  • 打赏
  • 举报
回复
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)
huangys1022 2013-09-15
  • 打赏
  • 举报
回复
补充下,现在服务是 2个路径下都有my.ini 配置看楼上贴的

56,685

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧