今天剛裝好的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)
這下成了!