PDA

View Full Version : Mysql Problem (Can't start mysql)


johntp
2006-12-30, 05:52 PM CST
when I type

service mysqld start


i get this error...

Initializing MySQL database: Neither host 'localhost' nor 'localhost' could be looked up with
/usr/bin/resolveip
Please configure the 'hostname' command to return a correct hostname.
If you want to solve this at a later stage, restart this script with
the --force option


My box connects to the internet just fine and I believe my machines hostname is localhost. Can any of you help me?

When I set my machines hostname to 127.0.0.1 it starts and runs just fine. I don't mind setting it to 127.0.0.1 but it seems like it could cause problems.

-John

brunson
2006-12-30, 06:34 PM CST
Did someone edit your /etc/hosts file and ignore the comment at the top:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost

Make sure there is a line for localhost in your hosts file.

johntp
2006-12-30, 10:37 PM CST
perfect, thank you!

netter
2006-12-30, 11:14 PM CST
My /etc/hosts has
::1 localhost.localdomain localhost
which seems the default setting in my Network Administration Tool. Should I change the IP to 127.0.0.1?

nick.stumpos
2006-12-30, 11:21 PM CST
::1 ids the ipv6 equivilant of 127.0.0.1, unless you are on a completely ipv6 network you may want to add the 127.0.0.1 line. but if you havent experienced any problems, then i wouldnt wory about i, until you do get a problem. then add it

Zigzagcom
2006-12-30, 11:48 PM CST
The IPv6 notation by itself breaks a lot of apps. There is a bug report on this

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=211800

It is best to have both in there

/etc/hosts
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
xxx.xxx.xxx.xxx hostname.domain.tld hostname

:)