4

i have a problem with MySQL Server on Gentoo. When starting with /etc/init.d/mysql it simply hangs an nothing is happening until you interrupt with CTL + C. By trying to start with mysqld directly, mysqld says:

131007 0:54:00 [ERROR] Can't start server: cannot resolve hostname!: Bad message

131007 0:54:00 [ERROR] Aborting

In many forums it was sugested to add the skip-name-resolve option to my.cnf. I tried this but it didn't help.

Has anyone had the same problem and knows how to solve this issue ?

Ottexx
  • 39
  • 1
  • 4

1 Answers1

2

Errors like you are seeing from mysql or other apps are usually due to problems in the file /etc/hosts and/or /etc/conf.d/hostname. Check the contents of both.

You need an entry in /etc/hosts for the hostname set by /etc/conf.d/hostname which is executed during bootup by /etc/init.d/hostname (I assume you have this set to run in one of the initial runlevels by rc).

If you have a static ip, go ahead and put the static ip in /etc/hosts. If you are using dhcp everywhere for a laptop, than add your hostname to the localhost ip address which is supposed to always exist regardless of whether you are online or not.

You should not have to set skip-name-resolve in my.cnf, but you may be to avoid issues by binding the mysql network socket just to localhost via adding the line: bind-address = 127.0.0.1 and removing any other references to other bind-addresses.

MattM
  • 33
  • 4