1.首先到http://dev.mysql.com/ 上下载windows版mysql5.6免安装zip包。然后将zip包解压到D:\mysql-5.6.20-winx64下。
2.复制mysql下的my-default.ini, 在同目录下创建my.ini. my.ini为mysql的配置。最简单的配置:
1 basedir=D:/mysql-5.6.20-winx642 datadir=D:/mysql-5.6.20-winx64/data
base config
我的配置为:
1 # For advice on how to change settings please see2 # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html3 # *** DO NOT EDIT THIS FILE. It‘s a template which will be copied to the4 # *** default location during install,and will be replaced if you5 # *** upgrade to a newer version of MySQL.6
7 [mysqld]
8 character-set-server=utf89
10 # Remove leading # and set to the amount of RAM for the most important data11 # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.12 # innodb_buffer_pool_size =128M13
14 # Remove leading # to turn on a very important data integrity option: logging15 # changes to the binary log between backups.16 # log_bin17
18 # These are commonly set,remove the # and set as required.19 # basedir =.....20 # datadir =.....21 # port =.....22 # server_id =.....23 basedir=D:/mysql-5.6.20-winx6424 datadir=D:/mysql-5.6.20-winx64/data25 port=3306
26
27 character-set-server=utf828 default-storage-engine=INNODB29 innodb_data_home_dir=D:/mysql-5.6.20-winx64/data30 innodb_data_file_path=ibdata1:12M:autoextend31 innodb_log_group_home_dir=D:/mysql-5.6.20-winx64/data32
33 innodb_buffer_pool_size=512M34 # Remove leading # to set options mainly useful for reporting servers.35 # The server defaults are faster for transactions and fast SELECTs.36 # Adjust sizes as needed,experiment to find the optimal values.37 # join_buffer_size =128M38 # sort_buffer_size =2M39 # read_rnd_buffer_size =2M40
41 # sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
my.ini
3.设置环境变量PATH。将D:\mysql-5.6.20-winx64\bin加入path中。
4.CMD下面尝试启动mysqld,并将后台log输出在屏幕。
5.注册mysql为windows service. 以后可以使用windows service来安装mysqld和卸载mysqld的服务.
6.进入服务管理器
7.启动MySQL服务
8.net start mysql 启动mysql服务,net stop mysql 停止mysql服务
9.也可以使用mysqladmin命令关闭mysql服务。
10.使用root用户登录mysql数据库
11.show databases;显示所有数据库
12.修改root帐户的登陆密码1234:
13.创建数据库需要指定中文编码方式
还有一些测试mysql安装的命令:
原文:http://www.cnblogs.com/qiyebao/p/3887055.html