How to fix MySQL State [2002] Database "Connection Refused " C panel : i am setting a new live server for my Laravel application its work perfectly on localhost but not on live server. Now its showing SQL State [2002] connection refused. i also try with mysqli_connect and PDO but error remains same.

    <?php
    $servername   = "examrunner.com";
    $database = "XXXXXXXX";
    $username = "XXXXXXX";
    $password = "XXXXXXXXXX";
    
    // Create connection
    $conn = new mysqli($servername, $username, $password);
    // Check connection
    if ($conn->connect_error) {
       die("Connection failed: " . $conn->connect_error);
    }
      echo "Connected successfully";
    ?>