title: How to create or connect to a localhost database in DataGrip?
body: <p>I previously had issues with MySQL on a Linux boot of my computer, and I realized that JetBrains has an SQL IDE for MacOS that I want to use to work on homework for my Database Systems class. The course is based on MySQL and following the steps <a href="https://www.jetbrains.com/help/datagrip/connecting-to-a-database.html#mysql" rel="nofollow noreferrer">here</a> was useless.</p>
  
  <p>I am just trying to create a local database to connect to and run various MySQL scripts for homework, but DataGrip will not let me create a database and connect to it. I am just using the defaults for MySQL (name is <code>@localhost</code>, driver is MySQL ver. 8.0.15 [latest], host <code>localhost</code>, port <code>3306</code>, user <code>root</code>, password <code>root</code>, database , URL <code>jdbc:mysql://localhost:3306</code>) and every time it says "Connection to @localhost failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up."</p>
  
  <p>My IDE looks exactly like the picture <a href="https://www.jetbrains.com/help/datagrip/connecting-to-a-database.html#mysql" rel="nofollow noreferrer">here</a> and the <code>test connection</code> button gives me the same error as above. I tried the accepted solution <a href="https://stackoverflow.com/questions/36193995/jetbrains-datagrip-cannot-connect-sql-server-without-specify-database">here</a> but that seemed to do nothing and I still can't connect to my localhost database.  I can't run <code>CREATE DATABASE my_database</code> as explained <a href="https://stackoverflow.com/questions/35464187/creating-new-database-in-datagrip-jetbrains">here</a> because I get the error <code>java.net.ConnectException: Connection refused (Connection refused).</code> </p>
  
  <p>What am I missing or doing wrong? I'm literally just using all of the default settings and nothing is working.</p>