title: Access denied for user 'user'@'%' to database 'db'
body: <p>What is this error ?
  mysql user, password, and Db its seem completely correct,
  Am using freehosting.com what should i do right now ?? :(</p>
  
  <pre><code>error_reporting(0);
  session_start();
  $mysqli = mysqli_connect("127.0.0.1", "user", "password", "db");
  
  /* check connection */
  if (mysqli_connect_errno()) {
      printf("Connect failed: %s\n", mysqli_connect_error());
      exit();
  }
  
  /* return name of current default database */
  if ($result = $mysqli-&gt;query("SELECT DATABASE()")) {
      $row = $result-&gt;fetch_row();
      printf("Default database is %s.\n", $row[0]);
      $result-&gt;close();
  }
  
  /* change db to world db */
  $mysqli-&gt;select_db("world");
  
  /* return name of current default database */
  if ($result = $mysqli-&gt;query("SELECT DATABASE()")) {
      $row = $result-&gt;fetch_row();
      printf("Default database is %s.\n", $row[0]);
      $result-&gt;close();
  }
  
  $mysqli-&gt;close();
  </code></pre>
  
  <blockquote>
    <p>Access denied for user 'user'@'%' to database 'db'</p>
  </blockquote>