title: Mysql cannot connect - Access denied (using password yes)
body: <p>I have hosting provided by eleven 2 and I just created a new MySQL user and gave it access to every action listed.</p>
  
  <p>I'm getting the following error </p>
  
  <pre><code>Warning: mysql_connect() [function.mysql-connect]: Access denied for user '(username is here, removed for posting)' (using password: YES) in /home/.../public_html/config.php on line 10
  </code></pre>
  
  <p>Here is my config file</p>
  
  <pre><code>//connection details have been removed for posting purposes
  
  &lt;?php
  
   define('SQL_SERVER',''); // Database Server
   define('SQL_USER',''); //  User
   define('SQL_PASS',''); //  Password
   define('SQL_DB',''); //  database
  
  
  
   mysql_connect(SQL_SERVER,SQL_USER,SQL_PASS) or die("Error: ".mysql_error()); // Connection to the server
   mysql_select_db(SQL_DB) or die("Error: ".mysql_error()); // Connecting to the database
  ?&gt;
  </code></pre>
  
  <p>I tried to do the following as suggested by this post <a href="https://stackoverflow.com/questions/5684861/access-denied-for-user-someuserlocalhost-using-password-yes">Access denied for user &#39;someuser&#39;@&#39;localhost&#39; (using password: YES)</a></p>
  
  <pre><code>GRANT ALL PRIVILEGES ON databasename.* TO 'bookorama'@'%' IDENTIFIED BY 'yourpassword';
  FLUSH PRIVILEGES;
  </code></pre>
  
  <p>But I got the following error "#1044 - Access denied for user". When I log into the CPanel and check out the database users, it shows the user that I tried to log in as, so I'm confused as to why it won't work.</p>
  
  <p><strong>EDIT - I got it to work. There was something wrong with the server. Contacted the host and they took care of it. Thanks for the replies.</strong></p>