If you go into your mySQL control panel, you can add users w/ passwords, and then add them to databases. You need to create a user, and then add that user to the database with ALL priveleges.
Now, once you do that, take the username and password and plug them into your script. The username is the username you just created and the password is the password associated with that user.
The first error message tells you that you couldn't connect, and the second says that since you didn't connect, mySQL didn't return a valid resource link to a database (because you didn't connect). So the errors are not separate but related.
~Brett