title: PHP script cannot access database in sql
body: <p>I am trying to connect to a MySQL database through a php script. It gives me this error from <code>mysql_error()</code>: Access denied for user <code>'@localhost'</code> to database <code>'userinfo'</code></p>
  
  <p><code>userinfo</code> is the database.</p>
  
  <p>my script is this</p>
  
  <pre><code>&lt;?php
  $servername = "localhost";
  $username = "root";
  $password = "'mm'";
  $database = "userinfo";
  $conn = mysqli_connect($servername, $username, $password);
  
  if (!$conn) {
      die("Connection failed: " . mysqli_connect_error());
  }
  
  echo "Connected successfully&lt;br&gt;";
  
  mysql_select_db($database) or die(mysql_error());
  
  echo "connected successfully to db:" . $database . "&lt;br&gt;";
  ?&gt;
  </code></pre>