google-cloud-sql

Can't connect to Cloud SQL Database using JDBC through Android Studio

百般思念 提交于 2021-01-29 11:50:24
问题 I have a Cloud Sql instance created that is running. I have been trying for a bit now to connect to it through Android Studio and Eclipse and have failed in both places. package com.example.testapplication3; import java.sql.*; public class ConnectToSql { public String run() { try { Class.forName("com.mysql.cj.jdbc.Driver"); String instanceConnectionName = "TheActualInstanceName"; String databaseName = "BudgetApp"; String IP_of_instance = "35.******"; String username = "root"; String password

Using gcloud cli within a cloud function

纵然是瞬间 提交于 2021-01-29 06:21:04
问题 There are great but still limited set of SDK access to GCP APIs within cloud function SDKs. e.g. Node. I want to call gcloud cli within a cloud function. Is this possible? e.g. gcloud sql instances patch my-database --activation-policy=NEVER The goal is nightly shutdown of an SQL instance 回答1: I believe you should use the Cloud SQL Admin API. If you're using the Python runtime for example you'd had 'google-api-python-client==1.7.8' (for example) to your requirements file and on the respective

Cannot access cloud SQL from firebase cloud functions in a different project

不羁的心 提交于 2021-01-29 00:38:07
问题 I have two GCP projects(one of them is a firebase project), and I am trying access a cloud SQL instance on one project from the other project's firebase cloud functions. I have followed the instructions here: https://cloud.google.com/sql/docs/mysql/connect-functions On this instruction, it says When connecting resources in two different projects, make sure that both projects have enabled the correct IAM roles and have given the service account the correct permissions. and I am not entirely

Accessing Cloud SQL from Cloud Run on Google Cloud

旧时模样 提交于 2021-01-27 18:21:47
问题 I have a Cloud Run service that accesses a Cloud SQL instance through SQLAlchemy . However, in the logs for Cloud Run, I see CloudSQL connection failed. Please see https://cloud.google.com/sql/docs/mysql/connect-run for additional details: ensure that the account has access to "<connection_string>" . Going to that link, it says that: "By default, your app will authorize your connections using the Cloud Run (fully managed) service account. The service account is in the format PROJECT_NUMBER

Failure to connect to proxy “Certificate signed by unknown authority”

Deadly 提交于 2021-01-27 13:42:34
问题 I'm attempting to connect to a CloudSQL instance via a cloudsql-proxy container on my Kubernetes deployment. I have the cloudsql credentials mounted and the value of GOOGLE_APPLICATION_CREDENTIALS set. However, I'm still receiving the following error in my logs: 2018/10/08 20:07:28 Failed to connect to database: Post https://www.googleapis.com/sql/v1beta4/projects/[projectID]/instances/[appName]/createEphemeral?alt=json&prettyPrint=false: oauth2: cannot fetch token: Post https://oauth2

gcloud beta run deploy fails after sucessfully uploading image, fails to enable API

让人想犯罪 __ 提交于 2021-01-27 06:30:51
问题 gcloud beta run deploy used to work but now I'm getting an error: $ gcloud beta run deploy $PROJECT --image $IMAGE_NAME --platform=managed --region us-central1 --project $PROJECT --add-cloudsql-instances $PROJECT-db ... DONE ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ID CREATE_TIME DURATION SOURCE IMAGES STATUS abcdefj-higj-lmnopquer-uvw-xyz 2019

Connection timeout on cloud sql

烂漫一生 提交于 2021-01-27 06:30:48
问题 I've got a Laravel app I'm trying to migrate to Google Cloud. I've already got it setup on App Engine but whenever I try to access it any non-static page which requires a DB connection the app throws up the following error: 2017-08-02 10:21:18,983 INFO _FILE_ONLY_ 2017-08-02 08:21:12 default[20170802t095328] [02-Aug-2017 08:21:12] WARNING: [pool app] child 62 said into stderr: "NOTICE: PHP message: [2017-08-02 08:21:12] production.ERROR: PDOException: SQLSTATE[HY000] [2002] Connection timed

Connection timeout on cloud sql

心已入冬 提交于 2021-01-27 06:30:21
问题 I've got a Laravel app I'm trying to migrate to Google Cloud. I've already got it setup on App Engine but whenever I try to access it any non-static page which requires a DB connection the app throws up the following error: 2017-08-02 10:21:18,983 INFO _FILE_ONLY_ 2017-08-02 08:21:12 default[20170802t095328] [02-Aug-2017 08:21:12] WARNING: [pool app] child 62 said into stderr: "NOTICE: PHP message: [2017-08-02 08:21:12] production.ERROR: PDOException: SQLSTATE[HY000] [2002] Connection timed

gcloud beta run deploy fails after sucessfully uploading image, fails to enable API

主宰稳场 提交于 2021-01-27 06:29:36
问题 gcloud beta run deploy used to work but now I'm getting an error: $ gcloud beta run deploy $PROJECT --image $IMAGE_NAME --platform=managed --region us-central1 --project $PROJECT --add-cloudsql-instances $PROJECT-db ... DONE ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ID CREATE_TIME DURATION SOURCE IMAGES STATUS abcdefj-higj-lmnopquer-uvw-xyz 2019

Google cloud sql instance infinite loading on restart

不问归期 提交于 2021-01-21 09:59:27
问题 We have google cloud sql instance with around 10.000 databases. Time to time mysql instance becomes unresponsive, so all we can do is just restart from the google console. (The reasons why it becomes unresponsive are not known currently :( ) Today we had similar issue, and we tried to restart it and now it is already restarting for more than an hour (usually it takes around 2 minutes to restart) What can be done ??? 回答1: Google cloud sql has limitation of 600 seconds on a query to run, after