1.11M Members

connection problem php to mysql

 
0
 

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.

 
1
 

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

 
0
 

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

 
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

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article