【问题标题】:Host 'localhost' is not allowed to connect to this MariaDB server不允许主机“localhost”连接到此 MariaDB 服务器
【发布时间】:2019-11-29 07:26:39
【问题描述】:

即使从终端登录 PhpMyAdmin 时,我也收到以下错误消息:

mysqli_real_connect(): (HY000/1130): Host 'localhost' is not allowed 连接到这个 MariaDB 服务器

此解决方案不起作用:

[mysql]
skip-grant-tables

我在 windows10 上使用 Xampp

【问题讨论】:

标签: php phpmyadmin xampp


【解决方案1】:

如果您使用的是 xampp,则只需添加 跳过授予表 C:\xampp71\mysql\bin\my.ini 文件中 [mysqld] 和 port= 3306 以上。

注意:我将 xampp 与 php7.1 和 mariadb 10.3.16 一起使用

【讨论】:

    【解决方案2】:

    该错误意味着您在使用 mysql 进行身份验证时尝试使用的用户没有权限。

    您可以通过确保用户拥有最广泛的权限来解决此问题:

    GRANT ALL PRIVILEGES ON *.* TO '<username>'@'localhost;
    

    【讨论】:

    • 请问,即使我无法以 root 身份登录,我应该在哪里执行此查询?
    猜你喜欢
    • 1970-01-01
    • 2011-02-26
    • 2023-03-29
    • 2014-04-02
    • 2013-03-31
    • 2012-06-07
    • 2011-02-02
    • 2013-02-11
    相关资源
    最近更新 更多