I found a useful link on how to reset the root password (since I apparently wasn't getting all privileges using the name and password I had). This is http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html. After doing this, specifying ('localhost', 'root', 'rootpassword' in the mysql_connect() statement does then allow me full access to all databases.