Jump to content

access denied for user 'apache@localhost'


kilx

Recommended Posts

i got below message on my server..

 

i don\'t use user \'apache\' to connect to mysql but this error mention that acces denied for user \'apache@localhost\'. what exactly happen to my server...

 

i have a config file store my database parameter like username, password define like below syntax

...
define(\"DB_USERNAME\", \"username\");
define(\"DB_PASSWORD\", \"<password>\");
define(\"DB_HOST\", \"localhost\");
...
[code]
then i make mysql connection using the defined value..
[code]
...
mysql_connect(DB_HOST, DB_USERNAME, DB_PASSWORD)
...

 

The error code!

Warning:  mysql_query(): Access denied for user: \'apache@localhost\' (Using password: NO) in /home/httpd/vhosts/minddivine.com/httpdocs/cssPortal/includes/functions/sessions.php on line 37
 
Warning:  mysql_query(): A link to the server could not be established in /home/httpd/vhosts/minddivine.com/httpdocs/cssPortal/includes/functions/sessions.php on line 37
 
Warning:  mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/minddivine.com/httpdocs/cssPortal/includes/functions/sessions.php on line 38
 
Warning:  mysql_query(): Access denied for user: \'apache@localhost\' (Using password: NO) in /home/httpd/vhosts/minddivine.com/httpdocs/cssPortal/includes/functions/sessions.php on line 43
 
Warning:  mysql_query(): A link to the server could not be established in /home/httpd/vhosts/minddivine.com/httpdocs/cssPortal/includes/functions/sessions.php on line 43

Link to comment
Share on other sites

Check the table \"user\" under MYSQL database . See if you have a user names \'apache\' and check if you had set any password for it. Generally passwords are encrypted and if you cant make out them you can flush them out or create new user. Check the manual for more details

http://www.phpfreaks.com/mysqlmanual.php

Link to comment
Share on other sites

  • 2 weeks later...
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.