FATAL ERROR: Neither host 'xxxxxx' nor 'localhost' could be look up with /usr/bin/resolveip

Posted March 24, 2016 11.4k views
MySQLGetting StartedLEMP

Hi Everyone,

Super newbie here at DO and anything command line. I followed all of the basic steps for setting up a droplet and completed the setup of UFW as well. When following the LEMP setup guide, I am stuck in the section where I must tell sql to create a directory structure by entering:

sudo mysql_install_db

I’m not sure why but I am generating the following upon entering it:

FATAL ERROR: Neither host ’droplet_name’ nor ‘localhost’ could be looked up with
Please configure the 'hostname’ command to return a correct
If you want to solve this at a later stage, restart this script
with the –force option

Can someone shed some light as to why this is happening or provide a potential solution?

Appreciate any help!

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.

Submit an Answer
1 answer

As the error indicates, you seem to have somehow misconfigured the hostname on your Droplet. Have you edited the /etc/hosts file? Make sure its contents include: droplet-name localhost