【问题标题】:PHP MySQL localhost connection problemsPHP MySQL localhost 连接问题
【发布时间】:2020-01-22 15:31:31
【问题描述】:

我将默认端口从 80 更改为 8080,但是当我运行 localhost 时,出现以下错误:

Cannot connect: invalid settings.
 mysqli_real_connect(): (HY000/2002): No connection could be made because the target machine actively refused it.
 Connection for controluser as defined in your configuration failed.
 mysqli_real_connect(): (HY000/2002): No connection could be made because the target machine actively refused it.
 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.
Retry to connect

【问题讨论】:

  • 你用什么来运行你的mysql数据库? WAMP?
  • Mysql 通过 3306 端口而不是 80 端口连接。 80用于apache服务器
  • 您好 MaartenDev,我正在使用 Xampp
  • 嘿 Anik,对不起,我把端口改为 3307,因为 apache 不是从 3306 开始的

标签: php mysql phpmyadmin


【解决方案1】:

检查您的防火墙,为您的 XAMPP/WAMPP 应用程序添加传入/传出规则并允许所有端口(启用复选框)。

查看此线程,因为您的问题似乎相似:Configure firewall to enable XAMPP working over LAN

一切顺利!

【讨论】:

    猜你喜欢
    • 2020-11-20
    • 2014-10-10
    • 1970-01-01
    • 2016-04-24
    • 2014-08-25
    • 1970-01-01
    • 1970-01-01
    • 2019-06-30
    • 2019-05-18
    相关资源
    最近更新 更多