loveccb Posted June 13, 2006 Share Posted June 13, 2006 Hello forum,Some of my users are getting this error when loading a page.Warning: mysql_query(): Access denied for user 'apache'@'localhost' (usingpassword: NO) in /var/www/vhosts/devsite.com/httpsdocs/include/spider_bcb.php online 22Warning: mysql_query(): A link to the server could not be established in/var/www/vhosts/devsite.com/httpsdocs/include/spider_bcb.php on line 22The 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. Quote Link to comment https://forums.phpfreaks.com/topic/11825-access-denied-for-user-apachelocalhost/ Share on other sites More sharing options...
AndyB Posted June 13, 2006 Share Posted June 13, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/11825-access-denied-for-user-apachelocalhost/#findComment-44823 Share on other sites More sharing options...
fenway Posted June 13, 2006 Share Posted June 13, 2006 The first error should never happen (no password = misconfiguration), but the second error can always happen sporadically. Quote Link to comment https://forums.phpfreaks.com/topic/11825-access-denied-for-user-apachelocalhost/#findComment-44853 Share on other sites More sharing options...
fmfsaisai Posted June 27, 2006 Share Posted June 27, 2006 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 Link to comment https://forums.phpfreaks.com/topic/11825-access-denied-for-user-apachelocalhost/#findComment-49964 Share on other sites More sharing options...
fenway Posted June 27, 2006 Share Posted June 27, 2006 [!--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. Quote Link to comment https://forums.phpfreaks.com/topic/11825-access-denied-for-user-apachelocalhost/#findComment-50127 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.