title: "Connect failed: Access denied for user 'root'@'localhost' (using password: YES)" from php function
body: <p>I wrote some function used by a php webpage, in order to interact with a mysql database. When I test them on my server I get this error:</p>
  
  <pre><code>"Connect failed: Access denied for user 'root'@'localhost' (using password: YES)" 
  </code></pre>
  
  <p>I am able to use them on my pc (using XAMPP) and I can navigate through the tables of the database using the command line in the server. However, the webpage fails to connect. I've checked the password but with no results. It's correct (otherwise I could not log in to mysql from the command line). </p>
  
  <p>The call of the function is the following:</p>
  
  <pre><code>$conn = new mysqli("localhost", "root", "password", "shop");
  </code></pre>
  
  <p>Do I have to set something in my server? Thanks</p>
  
  <p>Edit:
  PHP version 5.3.3-7+squeeze1
  mysql version:  5.1.49-3
  both on debian</p>