Cannot access localhost/phpmyadmin: (HY000/1130): Host ‘localhost’ is not allowed to connect to this MariaDB server

Posted by

Error:

local.ERROR: SQLSTATE[HY000] [1130] Host 'localhost' is not allowed to connect to this MariaDB server (Connection: mysql, SQL: delete from `cache`) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 1130): SQLSTATE[HY000] [1130] Host 'localhost' is not allowed to connect to this MariaDB server (Connection: mysql, SQL: delete from `cache`) at C:\\xampp\\htdocs\\myhospitalnow\\super-admin\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connection.php:825)
[stacktrace]
#0 C:\\xampp\\htdocs\\myhospitalnow\\super-admin\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connection.php(779): Illuminate\\Database\\Connection->runQueryCallback('delete from `ca...', Array, Object(Closure))
#1 C:\\xampp\\htdocs\\myhospitalnow\\super-admin\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connection.php(584): Illuminate\\Database\\Connection->run('delete from `ca...', Array, Object(Closure))
#2 C:\\xampp\\htdocs\\myhospitalnow\\super-admin\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connection.php(548): Illuminate\\Database\\Connection->affectingStatement('delete from `ca...', Array)

A simple illustrated solution!:

You can add skip-grant-tables to the my.ini file for the [mysqld] tag, under # The MySQL server, and restart the mysql server.

You can now open phpmyadmin and go to the user table in the mysql database. Make sure that the value of the password attribute is empty and that the value of host attribute is localhost. I was facing the second error. PHPMyAdmin was trying to connect with host value as ‘localhost’ and the table contained the value 127.0.0.1.

Remove skip-grant-tables from my.ini and restart the mysql server. This should work.

Leave a Reply

Your email address will not be published. Required fields are marked *

0
Would love your thoughts, please comment.x
()
x