kilx Posted November 21, 2003 Share Posted November 21, 2003 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 Quote Link to comment https://forums.phpfreaks.com/topic/1408-access-denied-for-user-apachelocalhost/ Share on other sites More sharing options...
shivabharat Posted November 21, 2003 Share Posted November 21, 2003 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 Quote Link to comment https://forums.phpfreaks.com/topic/1408-access-denied-for-user-apachelocalhost/#findComment-4672 Share on other sites More sharing options...
kilx Posted November 30, 2003 Author Share Posted November 30, 2003 what to do if i have a \'apache\' user..? do i need to delete or what..? thx! Quote Link to comment https://forums.phpfreaks.com/topic/1408-access-denied-for-user-apachelocalhost/#findComment-4761 Share on other sites More sharing options...
deRusett Posted November 30, 2003 Share Posted November 30, 2003 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 Quote Link to comment https://forums.phpfreaks.com/topic/1408-access-denied-for-user-apachelocalhost/#findComment-4767 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.