连接到外部数据库时出错 - mysqli_connect(): (HY000/2002): 连接超时

Error when connecting to external db - mysqli_connect(): (HY000/2002): Connection timed out

我将我的数据库移到了外部服务器,因为我的虚拟主机提供商提供的服务器太有限(无法远程访问)。所以我在 Vultr 服务器 (CentOS 7) 上设置了一个 MariaDB。在 phpmyadmin 中一切正常,我已经导入了另一个数据库。 当尝试从我的网站连接时,我收到此警告:

Warning: mysqli_connect(): (HY000/2002): Connection timed out in blabla/assets/php/config.php on line 8 ERROR: Could not connect. Connection timed out

PHP代码

define('DB_SERVER', '11.22.33.44');
define('DB_USERNAME', 'user');
define('DB_PASSWORD', 'pw');
define('DB_NAME', 'data');

$link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);

if($link === false){
    die("ERROR: Could not connect. " . mysqli_connect_error());
}

它在旧数据库上工作得很好,所以我想我遗漏了一些东西,但我想不出来。 我尝试打开 3306 端口,尝试不同的用户,允许所有 IP,但没有任何效果。

感谢所有试图提供帮助的人,但遗憾的是问题不在我这边。 原来 one.com 也不允许传出连接到其他数据库而不是自己的数据库。