简体   繁体   中英

When I uncomment innodb in my.cf it breaks

I'm wondering why when I uncomment the following lines in the /etc/my.cf it breaks mysql and I'm unable to restart it. I'm not all that great with mysql but I've been googling for hours trying to figure it out. Innodb is running on my server and all my db are running innodb. If I can provide you guys with more info please let me know how.

# Uncomment the following if you are using InnoDB tables 
#innodb_data_home_dir = /var/lib/mysql
#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 384M
#innodb_additional_mem_pool_size = 20M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 100M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1 
#innodb_lock_wait_timeout = 50 

Edit: This is what the mysql error log says

140129  8:53:21 [Note] Plugin 'FEDERATED' is disabled.
140129  8:53:21 InnoDB: The InnoDB memory heap is disabled
140129  8:53:21 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140129  8:53:21 InnoDB: Compressed tables use zlib 1.2.3
140129  8:53:21 InnoDB: Using Linux native AIO
140129  8:53:21 InnoDB: Initializing buffer pool, size = 384.0M
140129  8:53:21 InnoDB: Completed initialization of buffer pool
InnoDB: Error: data file /var/lib/mysql/ibdata1 is of a different size
InnoDB: 19072 pages (rounded down to MB)
InnoDB: than specified in the .cnf file 128000 pages!
140129  8:53:21 InnoDB: Could not open or create data files.
140129  8:53:21 InnoDB: If you tried to add new data files, and it failed here,
140129  8:53:21 InnoDB: you should now edit innodb_data_file_path in my.cnf back
140129  8:53:21 InnoDB: to what it was, and remove the new ibdata files InnoDB created
140129  8:53:21 InnoDB: in this failed attempt. InnoDB only wrote those files full of
140129  8:53:21 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
140129  8:53:21 InnoDB: remove old data files which contain your precious data!
140129  8:53:21 [ERROR] Plugin 'InnoDB' init function returned error.
140129  8:53:21 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140129  8:53:21 [ERROR] Unknown/unsupported storage engine: InnoDB
140129  8:53:21 [ERROR] Aborting

要保存此内容,只需将以下内容添加到/etc/mysql/my.cnf文件( 参考 ):

skip-innodb

Before do anything backup your data !

Remove files starting with ib_logfile , should be ib_logfile0 and ib_logfile1 in /var/lib/mysql.

Then re/start the server

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM