Jump to content


Photo

Access denied for user 'apache'@'localhost'


  • Please log in to reply
4 replies to this topic

#1 loveccb

loveccb
  • Members
  • Pip
  • Newbie
  • 3 posts

Posted 13 June 2006 - 12:27 AM

Hello forum,

Some of my users are getting this error when loading a page.

Warning: mysql_query(): Access denied for user 'apache'@'localhost' (using
password: NO) in /var/www/vhosts/devsite.com/httpsdocs/include/spider_bcb.php on
line 22

Warning: mysql_query(): A link to the server could not be established in
/var/www/vhosts/devsite.com/httpsdocs/include/spider_bcb.php on line 22

The line of code in question makes a simple INSERT into the database.

There are numorous other sql calls throughout the site and this is the ONLY place where this error arises.
Any ideas what is happening here? I've checked that the correct credentials are being called here.

Another note: This error message only appears sporadically.

Many thanks.

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 13 June 2006 - 01:52 AM

Best guess is that some of your users are finding a route to that query (through your logic or through links to that script) where the actual db_connection details are not read or have been overwritten by a program variable inadvertently.
Legend has it that reading the manual never killed anyone.
My site

#3 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 13 June 2006 - 05:12 AM

The first error should never happen (no password = misconfiguration), but the second error can always happen sporadically.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#4 fmfsaisai

fmfsaisai
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 27 June 2006 - 05:44 AM

Hmm When I googled the error code.I saw so many pages had problems like the first one.
BTW:It happen on my website sporadically too(The whole site,and I have to restart apache and mysql server)
Who can tell me why?
P.S. I comes from China,And I received terrible education(especially English),sorry for my English expression.

#5 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 27 June 2006 - 04:15 PM

[!--quoteo(post=388376:date=Jun 27 2006, 01:44 AM:name=fmfsaisai)--][div class=\'quotetop\']QUOTE(fmfsaisai @ Jun 27 2006, 01:44 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Hmm When I googled the error code.I saw so many pages had problems like the first one.
BTW:It happen on my website sporadically too(The whole site,and I have to restart apache and mysql server)
Who can tell me why?
P.S. I comes from China,And I received terrible education(especially English),sorry for my English expression.
[/quote]
Well, if the apache error happens, then it has to happen all the time -- it can't guess the password and be right some of the time! With regards to the second error, any connection can always temporarily fail / timeout.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users