3.配置环境变量:新建一个系统变量: MYSQL_HOME, 值:D:MySqlmysql5611 //这一步不做也行
4.修改MySql启动配置文件: 将安装目录下文件:my-default.ini 重命名为 my.ini
5.修改my.ini, 比如这个:
# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the
# and set as required. # basedir = ..... # datadir = ..... # port = ..... # server_id = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M
basedir = E:迅雷下载mysql-5.6.24-win32.1432006610mysql-5.6.24-win32
datadir = E:迅雷下载mysql-5.6.24-win32.1432006610mysql-5.6.24-win32data
default-storage-engine=MYISAM
port=3306
server-id=1
bind-address=0.0.0.0
character-set-server=utf8
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
这里需要额外说明的是:
[mysql]
default-character-set=utf8
[mysqld] character-set-server=utf8
这两个配置是为了保证中文的正常显示,根据需要修改为你期望的字符编码
[mysqld]
bind-address=0.0.0.0
这个配置是允许通过网络远程访问mysql服务,如果不去要,请删除此配置项,或者将地址改为:127.0.0.1
6.开始安装MySql
a) 以管理员身份打开cmd,定位到安装目录/bin下
b) 执行安装: mysqld --install MySql服务名
c) 启动MySql服务: net start MySql服务名
如果你已经安装了Mysql服务那就关闭Mysql服务按上述所说的修改my-default.ini文件之后再重启Mysql服务就可以解决中文乱码的问题了
终于成功了
另外,连接属性->使用MySQL字符集是不用改的,保持默认设置就行。
具体可参考两篇文章:http://blog.163.com/chenyao_2000/blog/static/1280109302011431476629/
http://www.cnblogs.com/northriver/archive/2013/06/07/3123385.html