1、数据库下载
Mysql官方网站:http://www.mysql.com/,数据库下载地址:http://www.mysql.com/downloads/。从官方网站可以找到两种文件包,一种是exe安装程序,另一种是zip压缩包。本人喜欢清爽的方式,所以下载的是ZIP压缩包。最新的5.6.22大概350M,下载还需要oracle帐号,自己注册一个好了。
2、数据库安装
解压出下载的文件mysql-5.6.22-win32.zip(有x86和x64两个版本)到任一目录,防止出现未知问题,最好放在非系统盘的非中文目录下,我的位置C:Program Filesmysql-5.6.22-win32。打开文件夹复制一份my-default.ini为my.ini的配置文件。

打开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. #mysql根目录 basedir ="C:Program Filesmysql-5.6.22-win32" #数据文件存放目录 datadir ="C:Program Filesmysql-5.6.22-win32data" # port = ..... 端口,默认3306 # 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 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES #服务端的编码方式 character-set-server=utf8 [client] #客户端编码方式,最好和服务端保存一致 loose-default-character-set = utf8 [WinMySQLadmin] Server = "C:Program Filesmysql-5.6.22-win32binmysqld.exe" |
如果需要更优化的my.ini配置文件可以参考这篇文章://www.jb51.net/article/84357.htm
上面设置为了保证服务正常运行,根据自己需要调整参数,修改后要重启服务。
3、注册Mysql服务
开始——运行——cmd,然后cd到mysql安装目录的bin下面,我的目录就是“C:Program Filesmysql-5.6.22-win32bin”,然后执行mysqld -install,提示服务安装成功!运行services.msc一看,确实有一个名为MySQL的服务了,启动它。有时启动失败,根据情况调整参数即可。
到这儿mysql安装就算完成了,其实还挺简单的,但如果没有操作过,整个过程估计要花不少时间,也是成长必须的过程。










