1. 从官网下载zip archive版本http://dev.MySQL.com/downloads/mysql/
2. 解压缩至相应目录,并配置环境变量(将*\bin添加进path中);
3. (重要)在根目录新建my.ini文件,写入以下内容:
4. 运行cmd(切记要用管理员身份);
5. (重要)执行命令mysqld --initialize
## 该步骤非常重要,因为之前的版本直接执行install命令便可安装服务,5.7之后需要初始化生成数据库文件(根目录下的data文件),否则后续无法启动服务;
6. 执行命令mysqld install,安装服务;
7. 执行命令net start mysql,启动服务;(停止服务net stop mysql)
8. 执行命令mysql -uroot -p,会报错ERROR 1045(28000),需要设置登录密码;
9. 打开配置文件my.ini,将skip-grant-tables前面的#去掉,然后重启服务,再次登录就可略过密码;
10. 进入mysql数据库,依次执行以下命令:
use mysql;
update user set authentication_string=password("root") where user="root";
flush privileges;
quit;
11. 打开配置文件my.ini,在skip-grant-tables前面加上#注释掉,然后重启服务,使用设置的密码再次登录;
12. 输入命令show databases,报错ERROR 1820 (HY000);
13. 修改一次密码set password=password("root");
14. 至此安装完成;
在启动mysql服务的时候可能会碰到mysql服务不能启动,又没有报错!
如果你想查看错误信息可输入:mysqld --console 启动错误信息
本人是根据下面信息排除错误
我的错误是下面红色字体部分解决的
Win7系统中提示:本地无法启动MySQL服务,报的错误:1067,进程意外终止的解决方法。
在本地计算机无法启动MYSQL服务错误1067进程意外终止。
这种情况一般是my.ini文件配置出错了
1、首先找到这个文件: Win7下的默认安装路径
C:\ProgramData\MySQL\MySQL Server 5.6\my.ini
打开此文件找到:default-storage-engine=INNODB
将default-storage-engine的值改为:MYISAM。
2、但是还有问题:因为以前你创建的那些数据库还是存在的(如果没有删除),
默认路径:
C:\ProgramData\MySQL\MySQL Server 5.6\data
这时可能会出来这种问题:
第一次设置的efault-storage-engine与第二次设置的值不一样,可能会导致
(1)发现无法选择添加事务支持数据引擎InnoDB
(2)可能会说不支持InnoDB等
解决方法:
删除:C:\ProgramData\MySQL\MySQL Server 5.6\data目录下的
ib_logfile0
ib_logfile1
ibdata1
重启服务,再次生成就OK了
3、如果还是不行,检查
C:\ProgramData\MySQL\MySQL Server 5.6\data 这个目录中的错误日志(扩展名我为.err),显示如下内容:
2015-06-24 08:53:30 7736 [Note] Plugin 'FEDERATED' is disabled.
2015-06-24 08:53:30 1724 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2015-06-24 08:53:30 7736 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-06-24 08:53:30 7736 [Note] InnoDB: The InnoDB memory heap is disabled
2015-06-24 08:53:30 7736 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2015-06-24 08:53:30 7736 [Note] InnoDB: Memory barrier is not used
2015-06-24 08:53:30 7736 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-06-24 08:53:30 7736 [Note] InnoDB: Not using CPU crc32 instructions
2015-06-24 08:53:30 1724 InnoDB: Error: unable to create temporary file; errno: 2
2015-06-24 08:53:30 7736 [ERROR] Plugin 'InnoDB' init function returned error.
2015-06-24 08:53:30 7736 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2015-06-24 08:53:30 7736 [ERROR] Unknown/unsupported storage engine: INNODB
2015-06-24 08:53:30 7736 [ERROR] Aborting
其中核心提示是这句,临时文件无法创建:
2015-06-24 08:53:30 1724 InnoDB: Error: unable to create temporary file; errno: 2
因此查看my.ini
[mysqld]区段内加入:
#自己指定的临时文件目录
tmpdir=d:\mysqltemp
d:\mysqltemp这个目录可以自己指定
end.