我多年来一直在谷歌的平台上使用MySQL(" Cloud SQL")。第一代。仅限SSL连接。几个月来我已经拿到了所有的证书并且运行得很好。我的证书没有过期。在过去的一天半里,我一直无法连接到数据库!试图重新启动数据库。由于周五开始的拒绝服务攻击,google是否改变了他们环境中的某些内容?
Exception in thread "main" java.sql.SQLNonTransientConnectionException: SSL Connection required, but not supported by server.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:550)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:537)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:527)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:512)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:480)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:498)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:494)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:72)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1634)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:637)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:351)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:224)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at ... my code
发生了什么?
答案 0 :(得分:1)
经过一些调查后,我发现我的服务器端证书丢失了。通过使用Developer Console重新启动我的CloudSQL实例,我发现了这一点。然后我调查了日志。
2016-10-22 12:42:47 0 [Note] (mysqld 5.6.31-log) starting as process 554455 ...
2016-10-22 12:42:47 554455 [Note] Semi-sync replication initialized for transactions.
2016-10-22 12:42:47 554455 [Note] Semi-sync replication enabled on the master.
2016-10-22 12:42:47 554455 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-10-22 12:42:47 554455 [Note] InnoDB: The InnoDB memory heap is disabled
2016-10-22 12:42:47 554455 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-10-22 12:42:47 554455 [Note] InnoDB: Memory barrier is not used
2016-10-22 12:42:47 554455 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-10-22 12:42:47 554455 [Note] InnoDB: Using CPU crc32 instructions
2016-10-22 12:42:47 554455 [Note] InnoDB: Initializing buffer pool, size = 96.0M
2016-10-22 12:42:47 554455 [Note] InnoDB: Completed initialization of buffer pool
2016-10-22 12:42:47 554455 [Note] InnoDB: Highest supported file format is Barracuda.
2016-10-22 12:42:51 554455 [Note] InnoDB: 128 rollback segment(s) are active.
2016-10-22 12:42:51 554455 [Note] InnoDB: 5.6.31 started; log sequence number 10094548402
2016-10-22 12:42:52 554455 [Note] RSA private key file not found: /sfs/project/database/data//private_key.pem. Some authentication plugins will not work.
2016-10-22 12:42:52 554455 [Note] RSA public key file not found: /sfs/project/database/data//public_key.pem. Some authentication plugins will not work.
2016-10-22 12:42:52 554455 [Note] Add the 'cloudsqladmin' user with the password hash '*ACE49C8814A8031C812FD739A573BDD4FFF8F7EE'
2016-10-22 12:42:53 554455 [Note] Event Scheduler: Loaded 0 events
2016-10-22 12:42:53 554455 [Note] : ready for connections.
Version: '5.6.31-log' socket: '' port: 0 (43, 47) (Google)
我仍然希望了解这是怎么回事,我会尽快更新。考虑到这种情况发生在Google方面,我不确定我是否可以直接修复它。我看到在开发控制台中有一个“重置SSL配置”选项。我希望我不必这样做,因为这意味着将新的证书推广到生产代码和所有开发人员。我的问题也在这里跟踪:https://code.google.com/p/googlecloudsql/issues/detail?id=188