Hi,
assuming you have the mySQL module built into php, it may be that you don't have proper user privileges for what you are trying to connect to?
Test this by trying to connect to the "test" database - it often doesn't require a username/password.
Does it throw any error mesgs?
cheers,
Steve