I've accidentally deleted my users table (removed all users) now whenever I try to access my database it says: "host localhost is not allowed to connect to this MYSQL Server". I've tried connecting directly, same error. I'm using apache xampp for this.
A very commonly asked question, try doing this (And it worked for me),
goto your mysql folder and there will be a file called "my.ini
". Simply add this
under the mysqld tag skip-grant-tables
. Save the file, restart your server.
If the problem still exists, refer to this link below
host 'localhost' is not allowed to connect to this MySQL server (#1130)
来源:https://stackoverflow.com/questions/25003590/host-localhost-is-not-allowed-to-connect-to-this-mysql-server