Question

LAMP Stack tutorial fails at MySQL install on Ubuntu 14.04

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.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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