title: Error connecting to database: (using class org.gjt.mm.mysql.Driver)
body: <p>I am trying to set up a connection in Pentaho 5.3.0.0-213 to mysql on localhost. I am using a Mac running OS 10.10.2. I can connect to the DB using Sequel Pro and have read through all the answers already given on this site (and others!) and have downloaded and copied mysql-connector-java-5.1.34-bin.jar to data-integration/lib and still get the same error.</p>
  
  <p>Any suggestions would be welcome.</p>
  
  <p>The whole error message is as follows:
  Error connecting to database [localhost_con] : org.pentaho.di.core.exception.KettleDatabaseException: 
  Error occurred while trying to connect to the database</p>
  
  <p>Error connecting to database: (using class org.gjt.mm.mysql.Driver)
  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.</p>
  
  <p>org.pentaho.di.core.exception.KettleDatabaseException: 
  Error occurred while trying to connect to the database</p>
  
  <p>Error connecting to database: (using class org.gjt.mm.mysql.Driver)
  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.</p>
  
  <pre><code>    at org.pentaho.di.core.database.Database.normalConnect(Database.java:417)
      at org.pentaho.di.core.database.Database.connect(Database.java:357)
      at org.pentaho.di.core.database.Database.connect(Database.java:310)
      at org.pentaho.di.core.database.Database.connect(Database.java:300)
      at org.pentaho.di.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:80)
      at org.pentaho.di.core.database.DatabaseMeta.testConnection(DatabaseMeta.java:2685)
      at org.pentaho.ui.database.event.DataHandler.testDatabaseConnection(DataHandler.java:546)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:313)
      at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:157)
      at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:141)
      at org.pentaho.ui.xul.swt.tags.SwtButton.access$500(SwtButton.java:43)
      at org.pentaho.ui.xul.swt.tags.SwtButton$4.widgetSelected(SwtButton.java:138)
      at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
      at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
      at org.eclipse.swt.widgets.Display.sendEvent(Unknown Source)
      at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
      at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
      at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
      at org.eclipse.swt.widgets.Widget.notifyListeners(Unknown Source)
      at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
      at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
      at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
      at org.eclipse.jface.window.Window.open(Window.java:796)
      at org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:389)
      at org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:318)
      at org.pentaho.di.ui.core.database.dialog.XulDatabaseDialog.open(XulDatabaseDialog.java:116)
      at org.pentaho.di.ui.core.database.dialog.DatabaseDialog.open(DatabaseDialog.java:59)
      at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.editConnection(SpoonDBDelegate.java:87)
      at org.pentaho.di.ui.spoon.Spoon.doubleClickedInTree(Spoon.java:3096)
      at org.pentaho.di.ui.spoon.Spoon.doubleClickedInTree(Spoon.java:3031)
      at org.pentaho.di.ui.spoon.Spoon.access$2400(Spoon.java:347)
      at org.pentaho.di.ui.spoon.Spoon$27.widgetDefaultSelected(Spoon.java:6121)
      at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
      at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
      at org.eclipse.swt.widgets.Display.sendEvent(Unknown Source)
      at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
      at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
      at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
      at org.eclipse.swt.widgets.Widget.notifyListeners(Unknown Source)
      at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
      at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
      at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1316)
      at org.pentaho.di.ui.spoon.Spoon.waitForDispose(Spoon.java:7979)
      at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:9310)
      at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:654)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.pentaho.commons.launcher.Launcher.main(Launcher.java:92)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at apple.launcher.LaunchRunner.run(LaunchRunner.java:116)
      at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:51)
      at apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)
  Caused by: org.pentaho.di.core.exception.KettleDatabaseException: 
  Error connecting to database: (using class org.gjt.mm.mysql.Driver)
  Communications link failure
  
  The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
  
      at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:561)
      at org.pentaho.di.core.database.Database.normalConnect(Database.java:400)
      ... 60 more
  Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
  
  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:377)
      at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1036)
      at com.mysql.jdbc.MysqlIO.&lt;init&gt;(MysqlIO.java:338)
      at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2232)
      at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)
      at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
      at com.mysql.jdbc.ConnectionImpl.&lt;init&gt;(ConnectionImpl.java:790)
      at com.mysql.jdbc.JDBC4Connection.&lt;init&gt;(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:377)
      at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
      at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
      at java.sql.DriverManager.getConnection(DriverManager.java:582)
      at java.sql.DriverManager.getConnection(DriverManager.java:185)
      at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:543)
      ... 61 more
  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.&lt;init&gt;(MysqlIO.java:297)
      ... 76 more
  </code></pre>
  
  <p>Hostname       : localhost
  Port           : 3306
  Database name  : my_learning_sql</p>