Need Help in Access Error

Hello Again,

Please help with this link problem.

Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘myuser’@‘localhost’ (using password: XYZ@123)

<?php
function connectTo() {
$host = “localhost”;
$db_name = “myDB”;
$username = “myUser”;
$password = “passs”;
$link = mysql_connect(“$host”, “$username”, “$password”, “$db_name”);
return $link;
}
?>

in another file is this line

$link = connectTo();

Thanks in advance

Check that the username, password and database are correct and that the username has permission to access the database.

btw you should really consider migrating over to either the mysqli or the PDO extenstions.

To reiterated @SpacePhoenix;s point, it looks as though you need to study the mysql permissions system – and in case you miss this snippet of information, probably one of the most common gotchas in LAMP development, [google]mysql flush privileges[/google] when you are done.

That is if you got the password correct in your attempt of course …