The simple answer is you are not connecting to the database (duh).
At the risk of stating the obvious, have you checked the exact name of the databases you created, is it on "localhost", and is your password any different to connect to a database, than it is to get into phpmyadmin.
I hope I'm not teaching granny to suck eggs ?
Are there any prefixes created before the database you named. An example is, you name your database "xyz" the database is created with your domain prefix along the lines of yourdomain_-_com_xyz

HTH