3

I am using Squirrel to connect to a MySQL instance being hosted on CloudBees. I downloaded what I believe is the correct JDBC driver, and installed it to Squirrel's lib directory at:

~/squirrel-sql-3.4.0/lib/mysql-connector-java-5.1.25-bin.jar

I then created a new DB alias (inside Squirrel) with the following properties:

Name: my_db
Driver: MySQL Driver
URL: jdbc:mysql://my-cloudbees-s3-instance.com:3306/my_db
User Name: my_db_user
Password: *******

When I try to connect to the DB, I get the following stack trace/error from Squirrel's built-in console:

java.util.concurrent.ExecutionException: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user 'my_db_user'@'%' to database 'my_db'
    at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:232)
    at java.util.concurrent.FutureTask.get(FutureTask.java:91)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.awaitConnection(OpenConnectionCommand.java:132)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$100(OpenConnectionCommand.java:45)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$2.run(OpenConnectionCommand.java:115)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user 'my_db_user'@'%' to database 'my_db'
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:171)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$000(OpenConnectionCommand.java:45)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$1.run(OpenConnectionCommand.java:104)
... 6 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user 'my_db_user'@'%' to database 'my_db'
    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:411)
    at com.mysql.jdbc.Util.getInstance(Util.java:386)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4187)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4119)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:927)
    at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1709)
    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1252)
    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2483)
    at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2516)
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2301)
    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)
    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
    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:411)
    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346)
    at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:133)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:167)
... 8 more

Is this an issue with:

  • Squirrel, or how I've configured it; or
  • The database/server (not properly configured, etc.); or
  • My connection properties; or
  • The MySQL/JDBC driver (wrong type, etc.); or
  • Something else?

It says "Access is denied" but I've check and rechecked my login credentials and they seem to be perfectly valid. Thanks in advance!

Important Update: I just downloaded and installed MySQL Workbench, created a new Stored Connection with the exact same info, and still getting the same error message:

Failed to Connect to MySQL at my-cloudbees-s3-instance.com:3306 with user my_db_user. Access denied for user 'my_db_user'@'%' to database 'my_db'.

To me, this indicates the MySQL server has been configured incorrectly, and rules out Squirrel, my connection properties, and the JDBC driver I installed for Squirrel...yes?!?

  • 1
    Somehow your setup generates following username: `'my_db_user'@'%'`, where it proabably should be `my_db_user`. – jlordo May 20 '13 at 15:16
  • Hmmm thanks @jlordo (+1) - I noticed this but figured it was typical syntax string sludge, so I didn't think anything of it. So I'm assuming this is a bug in the JDBC driver? Can you confirm that I downloaded the correct driver (type, etc.) for what I'm trying to use it for? Thanks again! –  May 20 '13 at 15:21
  • 1
    I have never used squirrel, but yes, the mysql driver is the one to use... – jlordo May 20 '13 at 15:40
  • Thanks again @jlordo (+1 again) - please take a look at my update: got the same error with MySQL Workbench. Any additional thoughts? –  May 20 '13 at 19:58
  • Can you login in in MySQL Workbench? – jlordo May 20 '13 at 20:21
  • No, that's the error I get when I try to login with the above credentials. –  May 21 '13 at 01:07
  • Your credentials are not correct, there is no other explanation – mirkobrankovic Jul 03 '15 at 10:00

0 Answers0