I’m using windows 10 and PhpMyAdmin on XAMPP server. Once while working, mysql server and phpmyadmin stop working with this error:
mysqli_real_connect(): (HY000/1130): Host 'localhost' is not allowed to connect to this MariaDB server
following errors I got in phpmyadmin:
Errors
- 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.
I research lot about this error and I got solution. I want to share the solution how I fixed this error.
Solution:
It’s due to crash of User table in MySQL database. The solution is very simple. Just go through following step:
- Open XAMPP control panel
- Click MySQL > Config > my.ini
- Add below line under [mysqld] tag. if [mysqld] tag not exists then you can create new.
skip-grant-tables
- Save my.ini
- Restart MySQL server by pressing STOP and START button
- Now visit http://localhost/phpmyadmin/ or http://127.0.0.1/phpmyadmin/
- Select mysql DB
- Repair the table named user by selecting checkbox then click on Repair table
One Comment
Ron
It worked for me (Windows 10, XAMPP)
Thank you.
Ron