Recently I have been trying to install MySQL on a Ubuntu 14.04 container. The files are downloaded fine, and installation continues to the point where one needs to specify the root password for MySQL - At this point, after specifying the password, the installation hangs as below:-
Setting up libaio1:amd64 (0.3.109-4) …
Setting up mysql-server-core-5.5 (5.5.55-0ubuntu0.14.04.1) …
Setting up mysql-server-5.5 (5.5.55-0ubuntu0.14.04.1) …
170705 8:40:45 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
170705 8:40:45 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
170705 8:40:45 [Note] /usr/sbin/mysqld (mysqld 5.5.55-0ubuntu0.14.04.1) starting as process 3846 …
Note that lsof -i does not show mysql. You need to run ss -tula: tcp LISTEN 0 50 127.0.0.1:mysql *:*
Also, mysql by default binds to localhost. Which means that if you want another container to access your MySQL server, you need to make it bind to all interfaces. Edit /etc/mysql/my.cnf and set it to the following:
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1
bind-address = 0.0.0.0
#
Thanks, yes, this too works for me on another host server with 16.04.2
LTS. Exact same host server configurations. On one it works without any
issues, on the other, the MySQL installation doesn’t complete (for some
reason). From my mysql error log :-
170705 22:52:42 [Warning] Using unique option prefix myisam-recover
instead of myisam-recover-options is deprecated and will be removed in a
future release. Please use the full name instead.
170705 22:52:42 [Note] Plugin ‘FEDERATED’ is disabled.
170705 22:52:42 InnoDB: The InnoDB memory heap is disabled
170705 22:52:42 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170705 22:52:42 InnoDB: Compressed tables use zlib 1.2.8
170705 22:52:42 InnoDB: Using Linux native AIO
170705 22:52:42 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.
170705 22:52:45 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
170705 22:52:45 InnoDB: Fatal error: cannot initialize AIO sub-system
170705 22:52:45 [ERROR] Plugin ‘InnoDB’ init function returned error.
170705 22:52:45 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE
failed.
170705 22:52:45 [ERROR] Unknown/unsupported storage engine: InnoDB
170705 22:52:45 [ERROR] Aborting
Pretty much explains what is going on. In essence, you need to either (a) add "innodb_use_native_aio = 0 “ to the mysqld section in /etc/my.cnf, or (b) make sure the sysctl config has the right "fs.aio-max-nr” setting on the container host (not the container).