edsilv
By:
edsilv

LAMP Stack tutorial fails at MySQL install on Ubuntu 14.04

July 11, 2016 642 views
LAMP Stack MySQL Ubuntu

Hi,

I've been following this tutorial to install the LAMP stack on an Ubuntu 14.04 droplet:

https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04

Apache installs and I can see "it works" on my public IP.

However, when I get to the MySQL installation I get the following log:

https://gist.github.com/edsilv/cd249a1788c8baf533002c16b6ad6a3d

And after running sudo mysql_install db I get:

Neither host 'srbska' nor 'localhost' could be looked up with
/usr/bin/resolveip
Please configure the 'hostname' command to return a correct
hostname.

Is this the error in the log I should be concerned with?

adduser: '/usr/bin/chfn -f MySQL Server mysql' returned error code 1. Exiting.
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.5_5.5.49-0ubuntu0.14.04.1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1

In the interests of staying consistent with your tutorial, I didn't want to try any answers I find on the web for that error in case I just make it worse... :-)

If I run service mysql start I get mysql: unrecognized service

The droplet was created from a snapshot I'd taken from another account after following the basic setup procedures to enable SSH and a non-root sudo user.

2 comments
  • The mysql install failed because of a permission problem when running sudo.

    You are required to change your password immediately (root enforced)
    chfn: PAM: Authentication token is no longer valid; new one required
    
  • When creating the droplet from the snapshot, I'd neglected to set the same SSH key as the one used on the account I copied it from. Recreating it with the same key fixed the issue.

1 Answer

This question was answered by @edsilv:

When creating the droplet from the snapshot, I'd neglected to set the same SSH key as the one used on the account I copied it from. Recreating it with the same key fixed the issue.

View the original comment

Have another answer? Share your knowledge.