MySQL - WARNING: The host '$HOSTNAME' could not be looked up with resolveip
#1
I've just install MySQL and upon starting the service I've receive the following message:
# service mysqld start
Initializing MySQL database: WARNING: The host 'myhost.mydomain.com' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
I've tried to run resolveip manually and got the following:
$ resolveip myhost.mydomain.com
resolveip: Unable to find hostid for 'myhost.mydomain.com': host not found
[/unix]
Although the hostname command gives the correct information:
$ hostname
myhost.mydomain.com
MySQL service seems to be running fine and I can successfully connect to it:
$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.21-cll MySQL Community Server (GPL) by Atomicorp

Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
Is that warning safe to ignore or do I have to configure something to fix it?
Thanks FreeVPS.us! for the free VPS and for all the knowledge that I've learned here at the forum.
#2
Sorry, this might sound stupid now but as the hostname for MySQL on your machine is myhost.mydomain.com which does not exist there is this problem.

The domain you used does not exist so MySQL is not able to use it, because it can't resolve it.

mydomain.com does exist but myhost.mydomain.com does not.

Why don't you change the hostname to the IP or localhost?
#3
That warning is completely normal, nothing to be worried of. I have encountered it in my installation and so will everyone.
Its just cause the domain is not pointed to the respective IP.

#4
@Murder,
Sorry, I forgot to mention that I've replace my actual hostname and domain name here on my post, like example.com, but actually I'm using a fully qualified domain.

@Retry
I just want to be sure, I was thinking that this is only important to fix if you will be connecting on MySQL from outside, since when connecting locally you don't even have to specify localhost just "mysql -u username -p".
Thanks FreeVPS.us! for the free VPS and for all the knowledge that I've learned here at the forum.
#5
Edit your /etc/hosts file and put in (it should already be there and modify it to your FQDN):

Code:
127.0.0.1            mysql.mydomain.com mysql



Also edit your /etc/my.cnf (if it isn't located in /etc/, try /etc/mysql)
Add in this line in the first section:

Code:
skip-name-resolve


Then restart mysql.

Code:
service mysqld restart

#6
@KiloServe,
Thanks! that eliminates the warning message.
I did not look at /etc/hosts because I think its already configured since I set my FQDN at SolusVM and besides hostname command gives the correct FQDN.

Btw, are you from KiloServe?
Thanks FreeVPS.us! for the free VPS and for all the knowledge that I've learned here at the forum.
#7
SolusVM's hostname changer does nothing on KVM other than change what the control panel says.

If you use the hostname set as in solusvm on the VPS, you need to add an A record for the VPS's hostname to fix this.
#8
Thanks for clarifying that dmm, I'm still quite new with SolusVM, but its good and has a simple GUI for managing virtual machines. I've also pointed an A record on my DNS provider, I think its all fix now.
Thanks FreeVPS.us! for the free VPS and for all the knowledge that I've learned here at the forum.


Forum Jump:


Users browsing this thread: 1 Guest(s)

Sponsors: FuzzyHosts - WeLoveServers - Ftpit - ZXPlay - BoneVM - GalaxyHostPlus - Kwicero LTD - Verelox- HostUS


BitCoin donations: 1DQxbstaTb5SWk6QC2gFeQUTFR64JX4cEo