无法使用MySQLI连接到远程MySQL数据库 - 超时

I have created two servers on Linux and installed LAMP on both, one I called web and the other is called app.

I would like to save a log from the web server on the app server - but when I try to connect to the app server, I get timeout.

My code is:

$mysqli = mysqli_connect("66:66:666:66", "username", "pass", "DB");
    if (!$mysqli) {
        die("Connection failed: " . mysqli_connect_error());
    }

Where 66:66:666:66 is the ip to the app server.

I have in the app server under PhpMyAdmin added user privileges to a user with the name "username" and then the host is "%".

Have i forgotten something?

Edit: I have already tried to add port number 3306 to the connection.