Hello everyone,

I want to grant access to mysql server located at 192.168.0.2 to user test with 192.168.0.4 IP.

I log into mysql as root and enter:
GRANT ALL PRIVILEGES on . to test@192.168.0.4 identified by 'userpasswd';
Then flush privileges;

However when I try to connect from 192.168.0.4 I get an error.
It only works when I put the above IP and hostname into /etc/hosts. But shouldn't it work without the need of adding it?

I run redhat 8.0 and mysql 3.23.54

Any thoughts?
Thanks

    This may or may not help - but i once notice that MySQL does not always identify the user by IP - so that said if you run the GRANT ALL.... again but replace the IP with HOSTNAME. As I said its a shot in the dark, but worth a try anyway.

      Fixed it
      I added skip-name-resolve in my.cnf under [mysqld] section
      Thanks anyway

        Write a Reply...