Jump to content

Archived

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

loveccb

Access denied for user 'apache'@'localhost'

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
The first error should never happen (no password = misconfiguration), but the second error can always happen sporadically.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[!--quoteo(post=388376:date=Jun 27 2006, 01:44 AM:name=fmfsaisai)--][div class=\'quotetop\']QUOTE(fmfsaisai @ Jun 27 2006, 01:44 AM) [snapback]388376[/snapback][/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.

Share this post


Link to post
Share on other sites

×

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.