i trying to learn php but found an issue.. im using mamp on a windows PC. and when im trying to connect my php with mysql a get this error:SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)..... in mysql i got the info username and password are 'root', host:localhost port:8889 and this is my code..
function connectToDb()
{
try{
return new PDO('mysql:host=localhost; dbname=tutorials','root','root');
}
catch (PDOException $e){
die ($e->getMessage());
}
}
any help will be appreciate.... thanks...