Gavin--博德

沉稳、专注--技术在于共享,共同成长。
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

MySql5.6解压版安装说明(整理)

Posted on 2014-01-17 09:42  Gavin·Gong  阅读(576)  评论(0编辑  收藏  举报
MySql5.6解压版安装说明

1、首先复制一份my-default.ini,并改名为my.ini
2、修改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.

[WinMySQLAdmin]
Server="D:/mysql/bin/mysqld.exe"
    #(这里是mysqld.exe的路径)

[client]
default-character-set =
utf8 #(这里是客户端输出编码,我的网站编码是utf8的)

[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 = 600M  #(Mysql数据缓存大小,根据自己内存大小跟需求调整)

# 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 = D:/mysql  #(Mysql目录路径)
datadir = d:/mysql/Database  #(Mysql库路径,默认是跟目录下data文件夹,我的是自定义路径,注意这个路径改了的话一定要把原data目录下的文件复制过去,不然会报1067错误)
character-set-server=utf8  #(服务器默认字符,跟上面保持一直)
port = 3306   #(Mysql使用端口,默认3306)
server_id = mysqlgy


# 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         (Join操作使用内存)
# sort_buffer_size = 2M           (排序使用内存)
# read_rnd_buffer_size = 2M       (随机读取数据缓冲区使用内存)(以上三条根据自己的情况设置)

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
说明:
红色部分为添加,蓝色部分为修改。至此,my.ini参数配置教程完毕。

3、注册MySQL服务,使MySQL可以在服务项目中启动或关闭 
1)进入安装目录\bin,执行: 
D:\mysql\bin>mysqld -install mysqlgy
显示:Service successfully installed. 则注册服务成功。 
  如果要删除服务: 
D:\mysql\bin>mysqld -remove mysqlgy
2)修改注册表: 
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\mysqlgy\ImagePath 修改为: 
d:\mysql\bin\mysqld --defaults-file="d:\mysql\my.ini" mysqlgy
                注意不要有多余的空格,不然会报1053错误
这样配置就可以使用net start mysqlgy命令正常启动MySQL。