title: PHPStorm doesn't connect to local MySQL
body: <p>I'm on OsX and trying to connect PHP Storm to MySQL.
  While using MAMP it worked fine but now that I'm using directly MySQL, downloaded from the official website, PHPStorm doesn't connect to MySQL anymore.</p>
  
  <p>PHPStorm returns this error:</p>
  
  <blockquote>
    <p>Connection to MyDatabase@localhost failed java.sql.SQLException:
    Communications link failure</p>
    
    <p>The last packet sent successfully to the server was 0 milliseconds
    ago. The driver has not received any packets from the server.     at
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at com.mysql.jdbc.Util.handleNewInstance(Util.java:389)     at
    com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1038)
      at com.mysql.jdbc.MysqlIO.(MysqlIO.java:338)  at
    com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2237)
      at
    com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2270)
      at
    com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2069)
      at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:794)    at
    com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:44)    at
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at com.mysql.jdbc.Util.handleNewInstance(Util.java:389)     at
    com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)    at
    com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
      in RemoteDriverImpl.connect(RemoteDriverImpl.java:27)   in
    RemoteUtil.access$100(RemoteUtil.java:36)     in
    RemoteUtil$RemoteInvocationHandler.invoke(RemoteUtil.java:229)    at
    com.sun.proxy.$Proxy122.connect(Unknown Source)   in
    LocalDataSource.getConnection(LocalDataSource.java:240) Caused by:
    java.net.ConnectException: Connection refused     at
    java.net.PlainSocketImpl.socketConnect(Native Method)     at
    java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:382)  at
    java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:241)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:228)   at
    java.net.SocksSocketImpl.connect(SocksSocketImpl.java:431)    at
    java.net.Socket.connect(Socket.java:527)  at
    com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:213)
      at com.mysql.jdbc.MysqlIO.(MysqlIO.java:297)  at
    com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2237)
      at
    com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2270)
      at
    com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2069)
      at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:794)    at
    com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:44)    at
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at com.mysql.jdbc.Util.handleNewInstance(Util.java:389)     at
    com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)    at
    com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
      in RemoteDriverImpl.connect(RemoteDriverImpl.java:27)</p>
  </blockquote>
  
  <p>I think it's something related to the configuration but I cannot understand which is the problem exactly.</p>
  
  <p>PHPMyAdmin connects correctly simply using user and password, PHP Storm, instead, doesn't want to connect in any way.</p>
  
  <p>Good tips to solve the issue? Thank you!</p>