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.)

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

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.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

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

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi