title: Unknown Database while Database does exist in phpMyAdmin (XAMPP)
body: <p>I'm trying to create a database for my platform in order to safe user information such as usernames, e-mail addresses and passwords. I recently installed XAMPP on my device and changed all port statements in the documents <code>my.ini</code>, <code>httpd.conf</code>, <code>php.ini</code>, and <code>config.inc.php</code> to 3307 since I already had MySQL running on port 3306 through MySQL Workbench. I created a database called <em><strong>useraccounts</strong></em> (<a href="https://i.stack.imgur.com/JNZUU.png" rel="nofollow noreferrer">img</a>) on the server with port 3307 and made a php file with the database name, the user, and the password as follows:</p>
  <pre><code>&lt;?php
    $db_user = &quot;root&quot;;
    $db_pass = &quot;&quot;;
    $db_name = &quot;useraccounts&quot;;
  
    $db = new PDO(&quot;mysql:host=localhost;dbname=&quot; . $db_name . &quot;;charset=utf8&quot;, $db_user, $db_pass);
    $db-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::EERMODE_EXCEPTION);
  </code></pre>
  <p>At first, when I didn't give in any password, it gave an error telling me I needed a password. When I filled in the password for the root user from MySQL Workbench, I got the following message:</p>
  <pre><code>Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1049] Unknown database 'useraccounts' in C:\xampp\htdocs\useraccounts\Config.php:7 Stack trace: #0 C:\xampp\htdocs\useraccounts\Config.php(7): PDO-&gt;__construct('mysql:host=loca...', 'root', '4.UruZ$fnw!ZMH5') #1 C:\xampp\htdocs\useraccounts\Registration.php(2): require_once('C:\\xampp\\htdocs...') #2 {main} thrown in C:\xampp\htdocs\useraccounts\Config.php on line 7
  </code></pre>
  <p>I'm not sure how to solve this. Does anyone know if there might be a cross over between my servers on port 3306 and 3307 or that there might be another problem or way to solve it?</p>
  <p>Any help is most appreciated.</p>