title: mysql connection with server(cpane) error
body: <p>Warning: mysqli::__construct(): (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.</p>
  <p>try{<br />
  $mysqli = new mysqli('cpanelhost','cpanel_db_user','cpanel_db_password','cpanel_db','port');
  if ($mysqli -&gt; connect_errno) {
  echo &quot;Failed to connect to MySQL: &quot; . $mysqli -&gt;connect_error;
  exit();<br />
  }
  $sql = &quot;INSERT INTO table (column1, column2) VALUES ('value1', 'value2')&quot;;<br />
  $mysqli-&gt;query($sql) ;<br />
  $mysqli-&gt;close();
  }
  catch(Exception $e){
  $mysqli-&gt;close();
  return $e;<br />
  }</p>
  <p><a href="https://i.stack.imgur.com/xG5Tj.png" rel="nofollow noreferrer">my code is here..</a></p>