MySQL Unable to install on 14.04 Container

Hi Guys

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 …

Nothing happens after this point.

Any ideas on what to look for?

Regards, Gabriel

I just tried it and it worked for me (albeit, it is LXD 2.14):

$ lxc launch ubuntu:t mysql
root@mysql:~# apt update
...
root@mysql:~# apt install mysql-server
...
Setting up mysql-client-core-5.5 (5.5.55-0ubuntu0.14.04.1) ...
Setting up mysql-client-5.5 (5.5.55-0ubuntu0.14.04.1) ...
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) ...
mysql start/running, process 3469
Setting up libhtml-template-perl (2.95-1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up mysql-server (5.5.55-0ubuntu0.14.04.1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.11) ...
root@mysql:~# lsof -i
COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
dhclient 1589 root    5u  IPv4  97476      0t0  UDP *:bootpc 
dhclient 1589 root   20u  IPv4  96884      0t0  UDP *:46615 
dhclient 1589 root   21u  IPv6  96885      0t0  UDP *:52868 
sshd     1921 root    3u  IPv4  99490      0t0  TCP *:ssh (LISTEN)
sshd     1921 root    4u  IPv6  99492      0t0  TCP *:ssh (LISTEN)
root@mysql:~# ss -tula
Netid  State      Recv-Q Send-Q   Local Address:Port       Peer Address:Port   
tcp    UNCONN     0      0                    *:bootpc                *:*       
tcp    UNCONN     0      0                    *:46615                 *:*       
tcp    UNCONN     0      0                   :::52868                :::*       
tcp    LISTEN     0      128                  *:ssh                   *:*       
tcp    LISTEN     0      50           127.0.0.1:mysql                 *:*       
tcp    TIME-WAIT  0      0         10.0.185.183:37842     91.189.88.161:http    
tcp    TIME-WAIT  0      0         10.0.185.183:41578     91.189.88.162:http    
tcp    LISTEN     0      128                 :::ssh                  :::*       
root@mysql:~# 

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
#

Hi Simos

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

170705 22:52:45 [Note] /usr/sbin/mysqld: Shutdown complete

This is the point where I am stuck.

Regards

Gabriel

Check out this thread: https://unix.stackexchange.com/questions/116520/mysql-server-wont-install-to-a-new-os-debian-ubuntu

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).

1 Like

Many thanks rkelleyrtp.