帮助中心 >  技术知识库 >  数据库 >  相关技术支持 >  Windows下安装MySQL 5.7.17压缩版后无法启动,错误1067:进程意外终止

Windows下安装MySQL 5.7.17压缩版后无法启动,错误1067:进程意外终止

2017-01-21 17:29:06 6785

Windows下安装MySQL 5.7.17压缩版后无法启动,错误1067:进程意外终止


首先下载最新的MySQL 5.7.17 Community 压缩版 for Windows 64-bit:

官方下载地址:http://www.landui.com/downloads/mysql/

2.1.png


然后解压到安装目录(如C:ProgMySQL)。接下来复制my-default.ini为my.ini,修改my.ini如下:

[mysql]

default-character-set=utf8mb4


[mysqld]

basedir = C:ProgMySQL

datadir = C:ProgMySQLdata

port = 3306

max_connections=200

character-set-server=utf8mb4

collation-server=utf8mb4_general_ci

default-storage-engine=INNODB

join_buffer_size = 128M

sort_buffer_size = 2M

read_rnd_buffer_size = 2M 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES


之后用“管理员身份”打开cmd,进入安装目录安装MySQL服务:


C:ProgMySQLin>mysqld install

Service successfully installed.

然后启动MySQL服务:


net start mysql

刚开始以为就这么简单,可是却报错了:

2.2.png

如果是通过Windows系统的“服务”启动,则提示:

2.3.png


查了许久,原来是:

If you installed MySQL using the Noinstall package, you may need to initialize the data directory:

1.Windows distributions prior to MySQL 5.7.7 include a data directory with a set of preinitialized accounts in the mysql database.

2.As of 5.7.7, Windows installation operations performed using the Noinstall package do not include a data directory. To initialize the data directory, use the instructions at Section 2.10.1.1, “Initializing the Data Directory Manually Using mysqld”.


具体可参考这两个链接:

http://www.landui.com/doc/refman/5.7/en/windows-initialize-data-directory.html

http://www.landui.com/doc/refman/5.7/en/data-directory-initialization-mysqld.html


原因找到了,那我们来手动Initialize Data Directory一下啊:

mysqld --defaults-file=C:ProgMySQLmy.ini --initialize-insecure

2.4.png


然后依次:

net start mysql

mysql -u root -p

应该就出来了。

希望对遇到的人有所帮助,究其原因就是5.7.7及?后的压缩包版本,更改为需要手动Initialize Data Directory了。



提交成功!非常感谢您的反馈,我们会继续努力做到更好!

这条文档是否有帮助解决问题?

非常抱歉未能帮助到您。为了给您提供更好的服务,我们很需要您进一步的反馈信息:

在文档使用中是否遇到以下问题: