How to resolve the following error with MYSQL while connecting with PHP?

rock

New member
I get the following error while connecting php with mysql. "Access denied for user 'ODBC'@'localhost' (using password: NO)".How to resolve this? what should be my username?
 
mysql_connect() takes 3 params
localhost
ur database user name generally 'root'
db pass

use this snippet and let us know if it works
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
// mysql_user - put ur db user name
// mysql_password - put ur db password

if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
 
Back
Top