Search code examples
phpmyadminxamppmagento2

invalid settings. mysqli_real_connect(): (HY000/1130): Host 'localhost' is not allowed to connect to this MariaDB server


I was getting the following error while accessing http://localhost/phpmyadmin on xampp server

enter image description here

  MySQL said: Documentation Cannot connect: invalid settings. mysqli_real_connect(): (HY000/1130): Host 'localhost' is not allowed to connect to this MariaDB server Connection for controluser as defined in your configuration failed. mysqli_real_connect(): (HY000/1130): Host 'localhost' is not allowed to connect to this MariaDB server 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.

so I added 'skip-grant-tables' in my.ini and I can access now. However While installing the Magento2 in the xampp server, I am receiving the following error :

    Database user does not have enough privileges. Please make sure SELECT, INSERT, UPDATE, DELETE,       CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, TRIGGER privileges are granted to database 'magento2'.

Will I not be able to install Magento unless 'skip-grant=tables' is removed? But after doing so I am not able to even access phpmyadmin. What is supposed to be done to solve the issue?

PS: I had installed WInNMP but after I realized this problem I uninstalled it but it didnt seem to solve the issue


Solution

  • It seems there was a problem in the user table of the MySQL

    Repaired it and then created the root user again which previously seems to have got deleted and I also removed the 'skip-grant-tables' from my.ini from Xampp control panel's configuration. Stopped and started the Xampp and Mysql server from the Xampp control Panel