Cromwell + Google Cloud MySQL

Hi,

I'd like my Cromwell to use a remote MySQL running on Google Cloud SQL platform. Here's how it should be done: https://cloud.google.com/sql/docs/mysql/connect-external-app

So something like:

database {
  profile = "slick.jdbc.MySQLProfile$"
  db {
    driver = "com.mysql.jdbc.Driver"
    url = "jdbc:mysql://google/cromwell?rewriteBatchedStatements=true&cloudSqlInstance=cromwell-sql&socketFactory=com.google.cloud.sql.mysql.SocketFactory&useSSL=false"
    user = "root"
    password = "..."
    connectionTimeout = 5000
  }
}

But I guess this won't work due to e.g. missing com.google...SocketFactory package.

Could you advise how to connect Cromwell to Google Cloud SQL? Thanks a lot.

Best Answer

  • moosesmooses
    Accepted Answer

    I got it working by simply ignoring the socket factory etc., like:

    database {
      profile = "slick.jdbc.MySQLProfile$"
      db {
        driver = "com.mysql.jdbc.Driver"
        url = "jdbc:mysql://<cloud-sql-ip>/cromwell?rewriteBatchedStatements=true&cloudSqlInstance=my-gcloud-sql&useSSL=false"
        user = "root"
        password = "foo"
        connectionTimeout = 5000
      }
    }
    

    My issue actually was that MySQL port was blocked in my Wifi.

Answers

  • moosesmooses Member
    Accepted Answer

    I got it working by simply ignoring the socket factory etc., like:

    database {
      profile = "slick.jdbc.MySQLProfile$"
      db {
        driver = "com.mysql.jdbc.Driver"
        url = "jdbc:mysql://<cloud-sql-ip>/cromwell?rewriteBatchedStatements=true&cloudSqlInstance=my-gcloud-sql&useSSL=false"
        user = "root"
        password = "foo"
        connectionTimeout = 5000
      }
    }
    

    My issue actually was that MySQL port was blocked in my Wifi.

Sign In or Register to comment.