Jump to content

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.
Link to comment
https://forums.phpfreaks.com/topic/11825-access-denied-for-user-apachelocalhost/
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.
  • 2 weeks later...
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.
[!--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.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.