第一步: 如果之前安装过mysql并且安装失败了,请卸载干净。 第二步 下载安装问,到mysql官方网站进行下载,这里给个链接直接可以下载不用注册用户登录了:http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.15-winx64.zip直接在迅雷中粘贴这个地址就可以
第一步:下载安装问,到mysql官方网站进行下载,这里给个链接直接可以下载不用注册用户登录了:http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.15-winx64.zip直接在迅雷中粘贴这个地址就可以下载。
第三步
开始安装,
将下载的zip包加压到你自己的目录,然后开始注册mysql服务,这是最关键的一步,比较简单,但是也比较容易出错。
(1)打开解压的文件,找到my-default.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 = .....
basedir=D:Program Filesmysql-5.6.15-winx64
datadir=D:Program Filesmysql-5.6.15-winx64/data
port=3306
server_id=10
# 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
红色部分是我们自己加的,根据自己情况填写
(2)配置环境变量
在path环境变量中配置 %MYSQL_HOME%bin;%SystemRoot%system32;%SystemRoot%SysWOW64
在MYSQL_HOME及SystemRoot中配置如下图:
(3)注册服务
打开cmd,指定到解压目录的bin目录,执行命令:
mysqld install MySQL --defaults-file="你的ini文件路径,也就是上面修改的文件路径"
(4)启动服务
net start mysql
没有报错的话,提示启动成功
(5)修改我们的登录密码:
mysql -u root -p 初次密码为空
mysql>use mysql;
mysql>update user set Password=password('newpassword') where User='root';
mysql>flush privileges;
ok,安装完成。
第四步操作数据了。
如果在启动服务时报错:'net' 不是内部或外部命令,也不是可运行的程序 或批处理文件。
则重新打开cmd,注意打开时以管理员身份运行,建议打开C:WindowsSysWOW64目录下的cmd。
引用:http://zghbwjl.blog.163.com/blog/static/120336672201311179182035/