daniish Posted October 17, 2007 Share Posted October 17, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/73570-solved-access-denied-for-user-0localhost-using-password-yes/ Share on other sites More sharing options...
Hybride Posted October 17, 2007 Share Posted October 17, 2007 It means you have a password for user 0, but you didn't write/include the right one into the query. This may be of some help: phpMyAdmin doc. Quote Link to comment https://forums.phpfreaks.com/topic/73570-solved-access-denied-for-user-0localhost-using-password-yes/#findComment-371187 Share on other sites More sharing options...
joeysarsenal Posted October 17, 2007 Share Posted October 17, 2007 having trouble connecting to the database go over your information. Quote Link to comment https://forums.phpfreaks.com/topic/73570-solved-access-denied-for-user-0localhost-using-password-yes/#findComment-371397 Share on other sites More sharing options...
daniish Posted October 17, 2007 Author Share Posted October 17, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/73570-solved-access-denied-for-user-0localhost-using-password-yes/#findComment-371402 Share on other sites More sharing options...
joeysarsenal Posted October 17, 2007 Share Posted October 17, 2007 try changing them i use xampp and have never had any problems mabye upgrade ur software Quote Link to comment https://forums.phpfreaks.com/topic/73570-solved-access-denied-for-user-0localhost-using-password-yes/#findComment-371410 Share on other sites More sharing options...
daniish Posted October 17, 2007 Author Share Posted October 17, 2007 I too have used XAMPP, but changing the software is not an option here because this database is on my host web server (Fast Hosting Direct). Does anyone have any alternative suggestions. Many thanks Quote Link to comment https://forums.phpfreaks.com/topic/73570-solved-access-denied-for-user-0localhost-using-password-yes/#findComment-371426 Share on other sites More sharing options...
~n[EO]n~ Posted October 17, 2007 Share Posted October 17, 2007 try this <?php $link = mysql_connect("localhost","username","password") or die("Could not connect: " . mysql_error()); mysql_select_db("database name", $link) or die ("Can\'t use dbmapserver : " . mysql_error()); ?> Quote Link to comment https://forums.phpfreaks.com/topic/73570-solved-access-denied-for-user-0localhost-using-password-yes/#findComment-371428 Share on other sites More sharing options...
daniish Posted October 17, 2007 Author Share Posted October 17, 2007 Thanks that seems to have worked. No errors occur and my Google Map displays, however, none of the data from the MySQL database is visible but thats probably a separate issue. Quote Link to comment https://forums.phpfreaks.com/topic/73570-solved-access-denied-for-user-0localhost-using-password-yes/#findComment-371436 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.