Jump to content


Photo

access denied for user 'apache@localhost'


  • Please log in to reply
3 replies to this topic

#1 kilx

kilx

    Newbie

  • New Members
  • Pip
  • 2 posts

Posted 21 November 2003 - 09:42 AM

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
[code=auto:0]
...
define(\"DB_USERNAME\", \"username\");
define(\"DB_PASSWORD\", \"<password>\");
define(\"DB_HOST\", \"localhost\");
...
[code=auto:0]
then i make mysql connection using the defined value..
[code]
...
mysql_connect(DB_HOST, DB_USERNAME, DB_PASSWORD)
...
[/code]

The error code!
[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
[/code]

#2 shivabharat

shivabharat

    Advanced Member

  • Members
  • PipPipPip
  • 371 posts
  • LocationChennai, India

Posted 21 November 2003 - 05:34 PM

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...mysqlmanual.php
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks

#3 kilx

kilx

    Newbie

  • New Members
  • Pip
  • 2 posts

Posted 30 November 2003 - 04:13 AM

what to do if i have a \'apache\' user..? do i need to delete or what..?
thx!

#4 deRusett

deRusett

    Member

  • Members
  • PipPip
  • 26 posts

Posted 30 November 2003 - 05:09 PM

you have

mysql_connect(DB_HOST, DB_USERNAME, DB_PASSWORD)


should it not say

mysql_connect(DB_HOST, DB_USERNAME, DB_PASSWORD);


or did you just omit that in the forum




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com