Topic: hostname issue with mysql install

I installed mysql with remi repo


yum --enablerepo=remi install mysql mysql-server

When i start mysqld with service mysqld start i get the following message


Initializing MySQL database:  Neither host 'sv1.servergreek.com' 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

/etc/hosts
# Generated by SolusVM
127.0.0.1       localhost localhost.localdomain
::1     localhost localhost.localdomain
167.88.125.157  sv1.servergreek.com sv1
2604:180:1::dc20:6b73   sv1.servergreek.com sv1

[root@sv1 ~]# hostname
sv1.servergreek.com

[root@sv1 ~]# hostname -f
hostname: Unknown host

Generated by SolusVM
NETWORKING=yes
NETWORKING_IPV6=yes
IPV6_AUTOCONF=no
HOSTNAME=sv1.servergreek.com


Thanks for the help in advance remi

Re: hostname issue with mysql install

Not related to MySQL.
Every server need to be able to resolve its name, and reverse.

Try adding its name to the 127.0.0.1 line (first pos.)

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 24 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.8 x86_64 + EPEL + remi + remi-php70

Re: hostname issue with mysql install

i know its not directly related to mysql but i never got this issue with older versions of mysql (installed from epel).Could you please guide me in solving this hostname issue.

# Generated by SolusVM
127.0.0.1       localhost localhost.localdomain sv1.servergreek.com sv1
::1     localhost localhost.localdomain
167.88.125.157  sv1.servergreek.com sv1
2604:180:1::dc20:6b73   sv1.servergreek.com sv1

and i restarted the network + reboot

Still i am not able to start mysql

Thanks so much remi

Re: hostname issue with mysql install

> Try adding its name to the 127.0.0.1 line (first pos.)

first pos, really means first, not last.

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 24 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.8 x86_64 + EPEL + remi + remi-php70

Re: hostname issue with mysql install

I fixed it....there was some bug in my bash script that wipe out the nsswitch.conf file

This line must be in there

hosts:  dns files

Re: hostname issue with mysql install

smile

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 24 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.8 x86_64 + EPEL + remi + remi-php70