Select Page
 mysqli_real_connect(): (HY000/1130): Host '192.168.1.6' is not allowed to connect to this MySQL server

Reason: This error occurs due to the default configuration the MySQL database is currently using. This configuration allows connections only from the ‘root’ user when coming from ‘localhost’ and not other IP address ranges.

Resolution

Log in to the MySQL on the remote database server and create a user who is allowed to access database server remotely from 192.168.1.6:

CREATE USER 'yetiforceuser2020'@'192.168.1.6' IDENTIFIED BY 'pass5word_of_yetiforce@user';
GRANT ALL ON yetiforce.* TO 'yetiforceuser2020'@'192.168.1.6' WITH GRANT OPTION;
alter user 'yetiforceuser2020'@'192.168.1.6' identified with mysql_native_password by 'pass5word_of_yetiforce@user';

mysql> FLUSH PRIVILEGES;

3 Error of phpMyAdmin:

 mysqli_real_connect(): (HY000/2054): The server requested authentication method unknown to the client

 mysqli_real_connect(): The server requested authentication method unknown to the client [caching_sha2_password]

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

let’s resolve the [caching_sha2_password] problem by adding following code to the “/etc/mysql/mysql.conf.d/mysqld.cnf” file

default_authentication_plugin=mysql_native_password