Not the answer you need?
Register and ask your own question!

Connection to server via clients hostname

UncertaintyPUncertaintyP EntrantCurrent User Role Beginner
I am trying to setup a configuration to connect to a mysql server via the clients hostname.

On the server I have the following entry in mysql.user (user | host): webadmin | webadmin-1
and the respective entry in /etc/hosts plus dnsmasq installed:
root@mysqladmin-1:~# getent hosts webadmin-1
192.168.10.19 webadmin-1 webadmin-1
root@mysqladmin-1:~# getent hosts 192.168.10.19
192.168.10.19 webadmin-1 webadmin-1
root@mysqladmin-1:~# host 192.168.10.19
19.10.168.192.in-addr.arpa domain name pointer webadmin-1.

Connecting from the client results in the following error:
root@webadmin-1:~# mysql -h mysqladmin-1 -u webadmin -p
Enter password:
ERROR 1130 (HY000): Host '192.168.10.19' is not allowed to connect to this MySQL server

but it works if changing the mysql.user entry (the host column) on the server to 192.168.10.19.

Is it possible to simply use the hostname of the client to connect?
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.