It is possible to connect normally using mysql -u database -p -h 10.0.0.3 on the server. Then, I wrote a test code called test. php and tested it successfully on other servers, but failed in directadmin Connection refused,Even with MySQL public IP, it cannot run。
```
<?php
$host = '10.0.0.3';
$username = 'testuser';
$password = '123456..';
$dbname = 'test';
$port = 3306;
$conn = new mysqli($host, $username, $password, $dbname, $port);
if ($conn->connect_error) {
die("failed: " . $conn->connect_error);
}
echo "ok";
$conn->close();
?>
```
```
<?php
$host = '10.0.0.3';
$username = 'testuser';
$password = '123456..';
$dbname = 'test';
$port = 3306;
$conn = new mysqli($host, $username, $password, $dbname, $port);
if ($conn->connect_error) {
die("failed: " . $conn->connect_error);
}
echo "ok";
$conn->close();
?>
```