title: "SQLSTATE[HY000] [1049] Unknown database" when accessing php file on localhost with MAMP
body: <p>I am running OSX and trying to access a database using MAMP on localhost.<br>
  I get the following error: "SQLSTATE[HY000] [1049] Unknown database".
  I have googled and tried everything. The files are from the textbook Murach's PHP and SQL. Its only this group of PHP files of all the lessons responding this way. These php files have hardly been edited except for the necessary $username and $password fields being updated which looks as follows: </p>
  
  <pre><code> $dsn = 'mysql:host=localhost;dbname=my_guitar_shop1';
   $username = 'root';
   $password = 'root';    
  </code></pre>