I moved my database to an external server because the one my webhosting provider offered is just too limited (no remote access). So I set a MariaDB up on a Vultr server (CentOS 7). everything works fine in phpmyadmin and I already imported the other db. When trying to connect from my website I get this warning tho:
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 code
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());
}
It worked perfectly fine with the old db so I assume Im missing someting but I can't figure it out. I tried opening the 3306 port, tried different users, allowing all IPs but nothing works.