Jump to content

[SOLVED] Access denied for user '0'@'localhost' (using password: YES)


daniish

Recommended Posts

Hello,

 

I am trying to return a set of results from a query on my database, but i get the following error message:

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user '0'@'localhost' (using password: YES) in /home/sites/globexposure.net/public_html/includes/dbinfo.php on line 2

Could not connect: Access denied for user '0'@'localhost' (using password: YES)

 

 

I suspect this means that i have not assigned the proper user privileges but i'm not sure how to check this through phpMyAdmin. Can anyone confirm this/know a solution?

 

Many thanks

The phpMyAdmin link suggests that i replace 'localhost' for 127.0.0.1 to resolve this issue, which i did and got the following error:

 

Parse error: syntax error, unexpected T_DNUMBER in /home/sites/globexposure.net/public_html/includes/dbinfo.php on line 2

 

 

My include dbinfo.php looks like this:

 

<?php
$link = mysql_connect(127.0.0.1,username,password) or die("Could not connect: " . mysql_error());
      mysql_select_db('database name') or die ("Can\'t use dbmapserver : " . mysql_error());
?>

 

Incidentally my username and database name are the same but this shouldn't cause any problems. What would you suggest?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.