com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:

后端 未结 1 393
日久生厌
日久生厌 2020-12-22 01:00

I have a google app engine connected project with which I am trying to connect to a google cloud sql database.I upload my project to google and via it I try to connect to th

相关标签:
1条回答
  • 2020-12-22 01:54

    Instance Id by default contains the project Id. So don't explicitly add project Id again.

    Project ID: sampleapp

    Instance Id: sampleapp:instance1 (This is how google cloud sql creates by default)

    Connections string:

    Correct:

    jdbc:google:mysql://sampleapp:instance1/dbname?user=root&password="+password+"useUnicode=true&characterEncoding=UTF-8";
    

    In correct

    jdbc:google:mysql://sampleapp:sampleapp:instance1/dbname?user=root&password="+password+"useUnicode=true&characterEncoding=UTF-8";
    
    0 讨论(0)
提交回复
热议问题