mysql 服务无法启动

今天刚装好的MYSQL 被我手动移动了位置,并重新注册为WINDOWS 服务,但是无法启动,

我查看MYSQL生成的启动日志{Mysql_Home}\data\WINDOWS-THPKTVL.err,内容如下:

121209 12:43:04 [Note] Plugin 'FEDERATED' is disabled.
121209 12:43:04 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.
121209 12:43:04 InnoDB: The InnoDB memory heap is disabled
121209 12:43:04 InnoDB: Mutexes and rw_locks use Windows interlocked functions
121209 12:43:04 InnoDB: Compressed tables use zlib 1.2.3
121209 12:43:04 InnoDB: CPU does not support crc32 instructions
121209 12:43:04 InnoDB: Initializing buffer pool, size = 490.0M
121209 12:43:04 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file .\ib_logfile0 is of different size 5242880 bytes
InnoDB: than specified in the .cnf file 102760448 bytes!
121209 12:43:04 [ERROR] Plugin 'InnoDB' init function returned error.
121209 12:43:04 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
121209 12:43:04 [ERROR] Unknown/unsupported storage engine: INNODB
121209 12:43:04 [ERROR] Aborting

见上面红色文字,是说日志文件实际大小5M和配置里面设定的100M不一致;

于是我删除{Mysql_Home}\data\ib_logfile0和ib_logfile1文件 ,然后重启服务,依然无法启动,下面日志

121209 12:45:11 [Note] Plugin 'FEDERATED' is disabled.
121209 12:45:11 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.
121209 12:45:11 InnoDB: The InnoDB memory heap is disabled
121209 12:45:11 InnoDB: Mutexes and rw_locks use Windows interlocked functions
121209 12:45:11 InnoDB: Compressed tables use zlib 1.2.3
121209 12:45:11 InnoDB: CPU does not support crc32 instructions
121209 12:45:11 InnoDB: Initializing buffer pool, size = 490.0M
121209 12:45:11 InnoDB: Completed initialization of buffer pool
121209 12:45:11 InnoDB: Log file .\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile0 size to 98 MB
InnoDB: Database physically writes the file full: wait...
121209 12:45:14 InnoDB: Log file .\ib_logfile1 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile1 size to 98 MB
InnoDB: Database physically writes the file full: wait...
121209 12:45:15 InnoDB: Cannot initialize created log files because
121209 12:45:15 InnoDB: data files are corrupt, or new data files were
121209 12:45:15 InnoDB: created when the database was started previous
121209 12:45:15 InnoDB: time but the database was not shut down
121209 12:45:15 InnoDB: normally after that.
121209 12:45:15 [ERROR] Plugin 'InnoDB' init function returned error.
121209 12:45:15 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
121209 12:45:15 [ERROR] Unknown/unsupported storage engine: INNODB
121209 12:45:15 [ERROR] Aborting

如上面红色所示,数据文件和日志文件时间上不一致;于是再删除{Mysql_Home}\ibdata1,再启动服务,

121209 12:46:04 [Note] Plugin 'FEDERATED' is disabled.
121209 12:46:04 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.
121209 12:46:04 InnoDB: The InnoDB memory heap is disabled
121209 12:46:04 InnoDB: Mutexes and rw_locks use Windows interlocked functions
121209 12:46:04 InnoDB: Compressed tables use zlib 1.2.3
121209 12:46:04 InnoDB: CPU does not support crc32 instructions
121209 12:46:04 InnoDB: Initializing buffer pool, size = 490.0M
121209 12:46:04 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file .\ibdata1 did not exist:
InnoDB: a new database to be created!
121209 12:46:04 InnoDB: Setting file .\ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
121209 12:46:04 InnoDB: Error: all log files must be created at the same time.
121209 12:46:04 InnoDB: All log files must be created also in database creation.
121209 12:46:04 InnoDB: If you want bigger or smaller log files, shut down the
121209 12:46:04 InnoDB: database and make sure there were no errors in shutdown.
121209 12:46:04 InnoDB: Then delete the existing log files. Edit the .cnf file
121209 12:46:04 InnoDB: and start the database again.
121209 12:46:04 [ERROR] Plugin 'InnoDB' init function returned error.
121209 12:46:04 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
121209 12:46:04 [ERROR] Unknown/unsupported storage engine: INNODB
121209 12:46:04 [ERROR] Aborting

上面红色信息,说所有的日志文件必须和数据文件一起创建,于是我把日志文件、数据文件一起删除,再重启

121209 12:46:37 [Note] Plugin 'FEDERATED' is disabled.
121209 12:46:37 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.
121209 12:46:37 InnoDB: The InnoDB memory heap is disabled
121209 12:46:37 InnoDB: Mutexes and rw_locks use Windows interlocked functions
121209 12:46:37 InnoDB: Compressed tables use zlib 1.2.3
121209 12:46:37 InnoDB: CPU does not support crc32 instructions
121209 12:46:37 InnoDB: Initializing buffer pool, size = 490.0M
121209 12:46:37 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file .\ibdata1 did not exist:
InnoDB: a new database to be created!
121209 12:46:37 InnoDB: Setting file .\ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
121209 12:46:37 InnoDB: Log file .\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile0 size to 98 MB
InnoDB: Database physically writes the file full: wait...
121209 12:46:40 InnoDB: Log file .\ib_logfile1 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile1 size to 98 MB
InnoDB: Database physically writes the file full: wait...
121209 12:46:42 InnoDB: Doublewrite buffer not found: creating new
121209 12:46:43 InnoDB: Doublewrite buffer created
121209 12:46:43 InnoDB: 128 rollback segment(s) are active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
121209 12:46:43 InnoDB: Waiting for the background threads to start
121209 12:46:43 InnoDB: 1.2.5 started; log sequence number 0
121209 12:46:43 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 6e184e72-41bb-11e2-aa27-00ff86268d0f.
121209 12:46:44 [Note] Event Scheduler: Loaded 0 events
121209 12:46:44 [Note] MySQL: ready for connections.
Version: '5.6.5-m8'  socket: ''  port: 3306  MySQL Community Server (GPL)

这下成了!

原文地址:https://www.cnblogs.com/zjoch/p/2809894.html