mysql innodb配置问题

my.cnf配置如下
# 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
innodb_log_files_in_group = 3
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 1500M
innodb_additional_mem_pool_size = 20M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 360M
innodb_log_buffer_size = 16M
innodb_flush_log_at_trx_commit = 2
innodb_lock_wait_timeout = 150
innodb_open_files = 600
innodb_max_dirty_pages_pct = 50
innodb_file_per_table = 1
innodb_flush_method=O_DIRECT
innodb_file_io_threads=4
这些配置完成后my.cnf的配置就结束了
但是重启的时候提示无法重启,这个时候要看日志文件 localhost.localdomain.err
130605 18:48:10 mysqld_safe mysqld from pid file /var/lib/mysql/localhost.localdomain.pid ended
130605 18:48:11 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130605 18:48:11 InnoDB: The InnoDB memory heap is disabled
130605 18:48:11 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130605 18:48:11 InnoDB: Compressed tables use zlib 1.2.3
130605 18:48:11 InnoDB: Initializing buffer pool, size = 1.5G
130605 18:48:11 InnoDB: Completed initialization of buffer pool
InnoDB: Error: data file /var/lib/mysql/ibdata1 is of a different size
InnoDB: 128000 pages (rounded down to MB)
InnoDB: than specified in the .cnf file 12800 pages!
130605 18:48:11 InnoDB: Could not open or create data files.
130605 18:48:11 InnoDB: If you tried to add new data files, and it failed here,
130605 18:48:11 InnoDB: you should now edit innodb_data_file_path in my.cnf back
130605 18:48:11 InnoDB: to what it was, and remove the new ibdata files InnoDB created
130605 18:48:11 InnoDB: in this failed attempt. InnoDB only wrote those files full of
130605 18:48:11 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
130605 18:48:11 InnoDB: remove old data files which contain your precious data!
130605 18:48:11 [ERROR] Plugin 'InnoDB' init function returned error.
130605 18:48:11 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130605 18:48:11 [ERROR] Unknown/unsupported storage engine: InnoDB
130605 18:48:11 [ERROR] Aborting
130605 18:48:11 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
130605 18:48:11 mysqld_safe mysqld from pid file /var/lib/mysql/localhost.localdomain.pid ended
从日志文件可以看出 InnoDB: Error: data file /var/lib/mysql/ibdata1 is of a different size  
ibdata1 这个文件和my.cnf----innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend 中的2000M 不一样
这个时候我们要把 ibdata1备份或者删除掉
然后重启mysql就OK了。


你可能感兴趣的:(mysql,InnoDB)