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:
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.
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.
×
The mysql install failed because of a permission problem when running sudo.
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.