【发布时间】:2016-04-07 13:34:56
【问题描述】:
将我的代码移动到我的主机服务器后,我在连接到 MySQL 时获得了连接。错误是:
PHP Warning: mysqli_connect(): (HY000/2002): Permission denied in
/hermes/bosoraweb112/b883/ipg.iancramergraphicscom/newdev/getContent.php
on line 15
这是我的代码:
$server = '127.0.0.1';
$username = 'admin_user_1';
$password = '********';
$dataBase = 'db_content';
$conn = mysqli_connect($server, $username, $password, $dataBase);
我发现其他一些人通过更改 SELinux 设置解决了这个问题,但我什至不知道如何尝试这样做。
如果是 SELinux,我如何访问它进行编辑?
【问题讨论】:
-
验证您是否能够从您用于此目的的主机/IP 连接到数据库。
-
我可以连接
-
来自什么?同一个主机?你的私人机器?
-
我可能不明白。如何测试连接?我对此很陌生。
-
可以用cli(命令行界面)吗?