Jdbc connection error from Google Apps Script

后端 未结 4 1143
离开以前
离开以前 2021-01-02 11:27

I have created a Google Cloud Project MySQL database to use in conjunction with the Jdbc service provided by Google Apps Script. Everything went as planned with the connecti

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-02 11:54

    Jdbc.getConnection works from both: my account and another account:

    var conn = Jdbc.getConnection('jdbc:mysql://' + IP + ':3306/' + database_name, user, password)

    I'm really confused because the recommended method did not work.

    There are two ways of establishing a connection with a Google Cloud SQL database using Apps Script's JDBC service:

    • (Recommended) Connecting using Jdbc.getCloudSqlConnection(url)
    • Connecting using Jdbc.getConnection(url)

    Notes:

    • IP is a Public IP address from the OVERVIEW tab in your database console:
    • I've allowed any host when created a user:

提交回复
热议问题