MySQL配置出现启动服务失败的解决方法

问题描述:

       在MySQL安装完成后,配置服务的最后一步启动服务总是失败,在控制面板->服务中手动启动该服务,也出现不能启动的问题,错误码为1067。在网上查找该问题,碰到的人还不少,基本上都是MySQL升级或者重新安装时会出现该问题,通用的解决方法是在命令行中删除该服务,然后卸载MySQL,在重新安装后进行配置。下面是网上找到的解决方法:

       C:>sc delete mysql

[SC] DeleteService SUCCESS

再重新使用MySQL Configuration Wizard,就不会有此错误了。

如果还是不行,重新启动一下电脑就OK

我根据上面步骤操作,结果还是不行,可能实际情况不同吧。

最后我将MySQL完全卸载,再重新安装在不同目录下,运行成功。

该方法虽然笨,但很有效,呵呵。

 

       但是使用这个方法发现对自己的问题没有效果,而且卸载MySQL后把注册表都删除干净,重新安装配置还是存在这个问题。无奈查找MySQL自带的帮助文件,发现这样一段话:

When installing and running MySQL for the first time, you may encountercertain errors that prevent the MySQL server from starting. The purpose of thissection is to help you diagnose and correct some of these errors.

Your first resource when troubleshooting server issues is the error log.The MySQL server uses the error log to record information relevant to the errorthat prevents the server from starting. The error log is located in the datadirectory specified in your my.ini file. The default datadirectory location is C:\Program Files\MySQL\MySQL Server 5.1\data.See Section 5.2.2, “The Error Log”.

Another source of information regarding possible errors is the consolemessages displayed when the MySQL service is starting. Use the NET START MySQL command from thecommand line after installing mysqld as a service to see any error messages regarding the starting of theMySQL server as a service.See Section 2.3.11,“Starting MySQL as a Windows Service.

意思是出现问题后第一个方式应该是查看MySQL的LOG文件,看问题出在哪里。

MySQL的LOG文件在my.ini中有定义:

datadir="C:/Documents and Settings/AllUsers/Application Data/MySQL/MySQL Server 5.1/Data/"

       在该目录下找***.err文件,发现log最后是下面几行:

InnoDB: Error: log file .\ib_logfile0 is of differentsize 0 25165824 bytes

InnoDB: than specified in the .cnf file 0 116391936bytes!

131108 16:44:04 [ERROR] Plugin 'InnoDB' init functionreturned error.

131108 16:44:04 [ERROR] Plugin 'InnoDB' registration as aSTORAGE ENGINE failed.

131108 16:44:04 [ERROR] Unknown/unsupported table type:INNODB

131108 16:44:04 [ERROR] Aborting

是InnoDB返回错误,原因是.\ib_logfile0的文件大小与配置文件中配置的不同,找到.\ib_logfile0,删除它,重启启动服务,OK!问题解决。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值