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

On starting MariaDB 5.5 I am getting the following error:

InnoDB: Unable to lock /var/lib/mysql/ibdata1

Initially ran into this error after a server reboot was done running MariaDB 5.1. Have carried out a number of troubleshooting steps including:

  • Upgrading MariaDB to 5.5
  • Moving and copying the ib* files
  • Removing Apparmor (which stopped syn overflow errors)

I am also getting other errors like:

InnoDB: Could not open or create data files.
InnoDB: If you tried to add new data files, and it failed here,
InnoDB: you should now edit innodb_data_file_path in my.cnf back
InnoDB: to what it was, and remove the new ibdata files InnoDB created
InnoDB: in this failed attempt. InnoDB only wrote those files full of
InnoDB: zeros, but did not yet use them in any way. But be careful: do not
InnoDB: remove old data files which contain your precious data!
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[Note] Plugin 'FEEDBACK' is disabled.
[ERROR] Unknown/unsupported storage engine: InnoDB
[ERROR] Aborting

But I am confident these are just a result of the initial error.

When I stop MariaDB (/etc/init.d/mysql stop) it says that MariaDB has stopped successfully. But when doing a ps -ef | grep mysql there is still a PID there.

If I kill the PID it is automatically recreated.

The output for ps for this PID is:

mysql     9173     1 17 09:43 ?        00:00:00 /usr/sbin/mysqld

I can login to MySQL when this PID exists and it shows the normal SHOW PROCESSLIST, but there is also a sleeping query.

Are there any other methods I can take to try and resolve this problem? Help would be greatly appreciated.

UPDATE #1

To get the server back to a known state I've done:

  • Restore backup prior to making any configuration changes
  • Update MariaDB to version 5.5
  • Stop Apache and MySQL
  • Note that the rogue MySQL PID still existed
  • Moved the my.cnf file to a new name
  • Stop MySQL again
  • Ran ps -ef | grep mysql to see if the PID was gone, it was
  • Moved the my.cnf back
  • Started MySQL
  • Noted that only valid MySQL PID's existed
  • Started Apache and noted that I couldn't get my websites to connected
  • Made Joels change to the my.cnf file (default_storage_engine = InnoDB TO default-storage-engine = innodb)
  • Started MySQL and Apache again

Right now, the websites can't be accessed. Nothing is being written to the syslog or Apache error logs that are untoward. I just can't figure out why I can't reach the websites.

I am getting this error in my syslog though:

[Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. Statement: UPDATE thread AS thread,taggregate_temp_1371329760 AS aggregate

Any ideas?

UPDATE #2

I am now receiving these errors in my syslog:

Jun 16 11:31:45 kernel: net_ratelimit: 5 callbacks suppressed
Jun 16 11:31:45 kernel: TCP: Possible SYN flooding on port 80. Sending cookies.

And now after rebooting my server I am receiving this error and the above...

Unable to lock /var/lib/mysql/ibdata1, error: 11
share|improve this question

1 Answer 1

I've had this issue before, it's related to your MariaDB configuration. You're probably specifying a line in your my.cnf like this one:

default-storage-engine = InnoDB

Specify the storage engine using all lowercase letters like this:

default-storage-engine = innodb
share|improve this answer
    
While this didn't fix all of the problems, this did fix one of them! Thanks a lot! –  Linnay Jun 16 '13 at 1:15

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.