Error while connecting to mysql from php

Hi Devs ,
Can anyone suggest me what can be the mistake as i am not able to connect to my mysql database, getting error like follows

Severity: Warning

Message: mysqli::__construct(): (HY000/2002): Connection timed out

Filename: controllers/LocationManager.php

Line Number: 43

Backtrace:
File: /home/vol12_2/epizy.com/######/htdocs/Locator/application/controllers/LocationManager.php
Line: 43
Function: __construct

File: /home/vol12_2/epizy.com/######/htdocs/Locator/index.php
Line: 315
Function: require_once

Connection timed out

where as my code is
$servername = “###_server_name”;
$username = “#####”;
$password = “password”;
$dbname = “dbname”;
define(‘DBHOST’, $servername);
define(‘DBUSER’, $username);
define(‘DBPASS’, $password);
define(‘DBNAME’, $dbname);

    $mysqli =new mysqli(DBHOST, DBUSER, DBPASS, DBNAME);
    if ($mysqli->connect_error) {
        echo $mysqli->connect_error;
    } else {
        echo "connected successfully";
    }

Please let me know ASAP if any1 having the solutions

What are you using as the server name? ####_server_name is not the format of our database hostnames, it’s usually something like sql###.epizy.com.

Ok got it thanx i mistakenly swapped the server and host name, but now when i am inserting data its showing me User ‘epiz_19821897’ has exceeded the ‘max_questions’ resource what does it means is there any kind of limitation over bulk insert on database ?

@remond said:
Ok got it thanx i mistakenly swapped the server and host name, but now when i am inserting data its showing me User ‘epiz_19821897’ has exceeded the ‘max_questions’ resource what does it means is there any kind of limitation over bulk insert on database ?

max_questions is the number of database queries you can execute in an hour. So yes, running a lot of insert queries could cause it.