We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,886 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

connection problem php to mysql

error msg: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'mon'@'localhost' (using password: YES) in C:\xampp\htdocs\project\include\connection.php on line 7
Could not Connect


///my connection.php code
<?php
define("contype","localhost");
define("user","mon");
define("passwd","affinity");
define("db","project");

$con=mysql_connect(contype,user,passwd) or die('Could not Connect');
$dbcon=mysql_select_db(db);
?>

//here's my scenario. i add new USER to my mysql in phpmyadmin and its username=mon, password=affinity + function(password) then i cant connect using this account... but using root account, works fine... help guys.

2
Contributors
3
Replies
31 Minutes
Discussion Span
1 Year Ago
Last Updated
4
Views
momonq1990
Light Poster
48 posts since Jul 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Did you give the user privileges to access the database projects?

rch1231
Veteran Poster
1,040 posts since Sep 2009
Reputation Points: 142
Solved Threads: 154
Skill Endorsements: 12

yes i give privileges select insert delete update create drop. and i also reload that... :(

momonq1990
Light Poster
48 posts since Jul 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

yes i got it.. i found my mistake :) thanks dude for pointing me near to my error... i found in my mysql>user my host is also mon instead of localhost thanks

momonq1990
Light Poster
48 posts since Jul 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0709 seconds using 2.71MB