Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have just come across the most random error I've seen my MySQL daemon spew out yet, everything was working fine, then all of a sudden it randomly crashed and it now outputting this when I start it up, not sure if it's because my 'my.cnf' file is minimal

Here's my 'my.cnf':

[mysqld]
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under different user or group,
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd
datadir=/var/lib/mysql/
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

Here's the errors:

120817  3:47:26 [Note] Plugin 'FEDERATED' is disabled.
120817  3:47:26 InnoDB: The InnoDB memory heap is disabled
120817  3:47:26 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120817  3:47:26 InnoDB: Compressed tables use zlib 1.2.5
120817  3:47:26 InnoDB: Using Linux native AIO
120817  3:47:26 InnoDB: Initializing buffer pool, size = 128.0M
120817  3:47:26 InnoDB: Completed initialization of buffer pool
InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
InnoDB: 384 pages (rounded down to MB) than specified in the .cnf file:
InnoDB: initial 640 pages, max 0 (relevant if non-zero) pages!
120817  3:47:26 InnoDB: Could not open or create data files.
120817  3:47:26 InnoDB: If you tried to add new data files, and it failed here,
120817  3:47:26 InnoDB: you should now edit innodb_data_file_path in my.cnf back
120817  3:47:26 InnoDB: to what it was, and remove the new ibdata files InnoDB created
120817  3:47:26 InnoDB: in this failed attempt. InnoDB only wrote those files full of
120817  3:47:26 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
120817  3:47:26 InnoDB: remove old data files which contain your precious data!
120817  3:47:26 [ERROR] Plugin 'InnoDB' init function returned error.
120817  3:47:26 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
120817  3:47:26 [ERROR] mysqld: unknown variable 'max_used_connections=0'
120817  3:47:26 [ERROR] Aborting

120817  3:47:26 [Note] mysqld: Shutdown complete

Any help would be greatly appreciated, thanks guys! :D

share|improve this question

migrated from stackoverflow.com Aug 17 '12 at 11:36

This question came from our site for professional and enthusiast programmers.

1  
Are you starting as root? But voting to move - not a programming question –  Adrian Cornish Aug 17 '12 at 2:11
    
No I was starting it as the MySQL user. –  Conner Stephen McCabe Aug 17 '12 at 9:50
add comment

2 Answers

up vote 0 down vote accepted

You'd be better off asking this in a server forum than progrmming forum?

I think you can delete the ibdata1 files safely and they get rebuilt, but to be sure rename the ibdata1 file(s) and restart MySQL. If that fails, rename it back and go to the right place ;)

If it does work, run mysqlcheck (http://dev.mysql.com/doc/refman/5.0/en/mysqlcheck.html) and/or possibly export all data as SQL (mysqldump), wipe the entire database and re-import from the dump file.

share|improve this answer
    
Nope, didn't work, the databases now contain no tables :/ So even if I do a dump it doesn't output code to create the tables that I had. –  Conner Stephen McCabe Aug 17 '12 at 9:54
add comment

Could be value of innodb_data_file_path got changed. Check your /etc/mysql/conf.d/* files.

If not specified otherwise, the default is

innodb_data_file_path=ibdata1:10M:autoextend
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.