Here is what's happening around line 80 in lib/databases/mysql:
# Start mysql-server
if is_fedora || is_suse; then
# service is not started by default start_service $MYSQL_SERVICE_NAME
fi
# Set the root password - only works the first time. For Ubuntu, we already
# did that with debconf before installing the package, but we still try,
# because the package might have been installed already.
sudo mysqladmin -u root password $DATABASE_PASSWORD || true
So, if we're on Ubuntu it asserts mysql was already started as it was installed.
The logs says ...
Selecting previously unselected package mysql-server-core-5.7.
Preparing to unpack .../mysql-server-core-5.7_5.7.21-0ubuntu0.16.04.1_amd64.deb ...
Unpacking mysql-server-core-5.7 (5.7.21-0ubuntu0.16.04.1) ...
Selecting previously unselected package mysql-server-5.7.
Preparing to unpack .../mysql-server-5.7_5.7.21-0ubuntu0.16.04.1_amd64.deb ...
Unpacking mysql-server-5.7 (5.7.21-0ubuntu0.16.04.1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.7.21-0ubuntu0.16.04.1_all.deb ...
Unpacking mysql-server (5.7.21-0ubuntu0.16.04.1) ...
Setting up mysql-server-core-5.7 (5.7.21-0ubuntu0.16.04.1) ...
Setting up libevent-core-2.0-5:amd64 (2.0.21-stable-2ubuntu0.16.04.1) ...
Setting up mysql-server-5.7 (5.7.21-0ubuntu0.16.04.1) ...
Setting up mysql-server (5.7.21-0ubuntu0.16.04.1) ...
... but nothing about starting mysql-server.
I'd suggest replacing the "if suse || redhat; then start mysql" with "if mysql not running; then start mysql" or something similar, that ought to be a more robust check. Or just try to start mysql no matter if it's already running or not.
Here is what's happening around line 80 in lib/databases/ mysql:
# Start mysql-server
start_ service $MYSQL_SERVICE_NAME
if is_fedora || is_suse; then
# service is not started by default
fi
# Set the root password - only works the first time. For Ubuntu, we already
# did that with debconf before installing the package, but we still try,
# because the package might have been installed already.
sudo mysqladmin -u root password $DATABASE_PASSWORD || true
So, if we're on Ubuntu it asserts mysql was already started as it was installed.
The logs says ...
Selecting previously unselected package mysql-server- core-5. 7. server- core-5. 7_5.7.21- 0ubuntu0. 16.04.1_ amd64.deb ... core-5. 7 (5.7.21- 0ubuntu0. 16.04.1) ... server- 5.7_5.7. 21-0ubuntu0. 16.04.1_ amd64.deb ... 0ubuntu0. 16.04.1) ... server_ 5.7.21- 0ubuntu0. 16.04.1_ all.deb ... 0ubuntu0. 16.04.1) ... core-5. 7 (5.7.21- 0ubuntu0. 16.04.1) ... core-2. 0-5:amd64 (2.0.21- stable- 2ubuntu0. 16.04.1) ... 0ubuntu0. 16.04.1) ... 0ubuntu0. 16.04.1) ...
Preparing to unpack .../mysql-
Unpacking mysql-server-
Selecting previously unselected package mysql-server-5.7.
Preparing to unpack .../mysql-
Unpacking mysql-server-5.7 (5.7.21-
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-
Unpacking mysql-server (5.7.21-
Setting up mysql-server-
Setting up libevent-
Setting up mysql-server-5.7 (5.7.21-
Setting up mysql-server (5.7.21-
... but nothing about starting mysql-server.
I'd suggest replacing the "if suse || redhat; then start mysql" with "if mysql not running; then start mysql" or something similar, that ought to be a more robust check. Or just try to start mysql no matter if it's already running or not.