Jan 192015
 
Article MySQL

A MySQL default setup is easily carried out on a Debian or Ubuntu system with a call to apt-get:

sudo apt-get install mysql-client mysql-server

However, this command fails if we are installing MySQL 5.5 on a system running inside a virtual machine using OpenVZ virtualization technology.

The installation prints error messages that make reference to errors in the execution of io_setup() while using Linux native AIO (Asynchronous I/O)

141009 1:56:52 InnoDB: Using Linux native AIO
141009 1:56:52 InnoDB: Warning: io_setup() failed with EAGAIN. Will make 5 attempts before giving up.
InnoDB: Warning: io_setup() attempt 1 failed.
InnoDB: Warning: io_setup() attempt 2 failed.
InnoDB: Warning: io_setup() attempt 3 failed.
InnoDB: Warning: io_setup() attempt 4 failed.
InnoDB: Warning: io_setup() attempt 5 failed.
141009 1:56:54 InnoDB: Error: io_setup() failed with EAGAIN after 5 attempts.
InnoDB: You can disable Linux Native AIO by setting innodb_use_native_aio = 0 in my.cnf
141009 1:56:54 InnoDB: Fatal error: cannot initialize AIO sub-system
141009 1:56:54 [ERROR] Plugin 'InnoDB' init function returned error.
141009 1:56:54 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
141009 1:56:54 [ERROR] Unknown/unsupported storage engine: InnoDB
141009 1:56:54 [ERROR] Aborting

If we have stepped into this issue, we can fix it as follows:

First, uninstall completely the failed mysql installation:

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-5.5

Next, create a text file /etc/my.cnf with the following content:

[mysqld]
innodb_use_native_aio = 0

Finally, install again mysql:

sudo apt-get install mysql-client mysql-server

And that’s all!

References

 Posted by at 11:26 am

 Leave a Reply

(required)

(required)