title: MySQLSyntaxErrorException: Unknown database - JDBC - Java EE
body: <p>Really odd issue here, it was working a few days ago. I create a new database for a new project and I go to run it and I get the following error</p>
  
  <pre><code>com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database
  </code></pre>
  
  <p>So I went back to my older projects and tried to run them. Same error.</p>
  
  <p>The database is definitely there, it's named correctly, i'm using user "root". MySQL is started, I can interact with it in terminal... any particular reason I may be getting this error?</p>
  
  <pre><code>Connection c =  DriverManager.getConnection("jdbc:mysql://localhost/twittermap","root","");
  </code></pre>
  
  <p>In terminal:</p>
  
  <pre><code>select CURRENT_USER()
  </code></pre>
  
  <p>will return root@localhost</p>
  
  <pre><code>SELECT DATABASE() FROM DUAL;
  </code></pre>
  
  <p>returns twittermap</p>
  
  <pre><code> show variables like 'port';
  </code></pre>
  
  <p>returns 3306</p>
  
  <p>If any more information is required please let me know and I will post it immediately. This is most likely a simple fix but I just can't wrap my head around it. Thanks all, really appreciate the help!</p>
  
  <p>EDIT: I ran netstat -tnl and 127.0.0.1:3306 is NOT listed.. ?</p>