title: Warning: mysqli_connect(): (HY000/1044): Access denied for user ''@'localhost' to database 'dbtest'
body: <p>When i try to connect to my sql server, it gives me the error: </p>
  
  <blockquote>
    <p>Warning: mysqli_connect(): (HY000/1044): Access denied for user ''@'localhost' to database 'dbtest'. </p>
  </blockquote>
  
  <p>I just created the user and gave it all permissions, but i still dosent work. Before i used another account, but i couldn't change the database perssions for it. Anybody who have a potential fix?</p>
  
  <p>Here is the connect code.</p>
  
  <pre><code>&lt;?php
  
      // this will avoid mysql_connect() deprecation error.
      error_reporting( ~E_DEPRECATED &amp; ~E_NOTICE);
      // but I strongly suggest you to use PDO or MySQLi.
  
      $DBHOST= "localhost";
      $DBUSER= "testadmin";
      $DBPASS= "";
      $DBNAME= 'dbtest';
  
      $conn = mysqli_connect(localhost, testadmin, $DBPASS, dbtest);
  //  $dbcon = mysql_select_db($DBNAME);
  
      if ( !$conn ) {
          die("Connection failed : " . mysql_error());
      }
  
  ?&gt;
  </code></pre>