PHP MySQL 本地主机连接问题

标签 php mysql phpmyadmin

我将默认端口从 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

最佳答案

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

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

祝一切顺利!

关于PHP MySQL 本地主机连接问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58047585/

相关文章:

PHP - 如何将大量文件路径存储到 MySQL 数据库?

php - 从更新链接更新 mySQL

mysql - 无法在本地 WAMP 服务器上更改 phpmyadmin 中的服务器连接排序规则

php - 如何在表单提交时创建cookie?

php - Zend框架prepareStatementForSqlObject和execute不起作用

php - while 循环运行时的进度条

php - PDO 类的通用插入方法

mysql - 获取随机记录

php - 在 php 中将整数转换为 double

mysql - 用于从多个大表中创建新表的 sql 语法