不允许主机 localhost 连接到此 MySQL 服务器 [英] host localhost is not allowed to connect to this MySQL server
问题描述
现在,每当我尝试访问我的数据库时,我不小心删除了我的用户表(删除了所有用户),它说:主机 localhost 不允许连接到这个 MYSQL 服务器".我试过直接连接,同样的错误.我正在为此使用 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屋!