I just tried PHP code like:
$mysqli = new mysqli("x.x.x.x", "root", "123456", "mysql");
Then I got error:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
I have tried lots of ways. and I connect successfully through PHPStorm's DataSource module.