主机localhost不允许连接到此MySQL服务器 [英] host localhost is not allowed to connect to this MySQL server
问题描述
现在,每当我尝试访问数据库时,我不小心删除了我的用户表(已删除所有用户),它说:不允许主机本地主机连接到此MYSQL Server".我试过直接连接,同样的错误.我正在为此使用apache xampp.
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.
推荐答案
一个非常常见的问题,尝试执行此操作(它对我有用),
转到您的 mysql 文件夹,将有一个名为my.ini
的文件.只需在[mysqld]
部分中添加skip-grant-tables
(不带参数),如下所示:
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 skip-grant-tables
(without an argument) in the [mysqld]
section as below:
[mysqld]
port=3306
skip-grant-tables
保存文件,重新启动服务器. 如果问题仍然存在,请参考此链接.
Save the file, restart your server. If the problem still exists, refer to this link.
这篇关于主机localhost不允许连接到此MySQL服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!