google-cloud-sql

Google Cloud Functions - Connect to Cloud SQL via SSL

限于喜欢 提交于 2020-01-14 03:13:49
问题 The GCF Cloud SQL documentation does not show how to connect via the socket using SSL. Here is my config, however when I try to connect I get an ECONNREFUSED error. But when I try to connect to a non-SSL database it works fine. Any ideas? const mysql = require('mysql'); const mysqlConfig = { connectionLimit: 1, user: dbUser, password: dbPassword, database: dbName, ssl: { ca: await getFileContents(bucketName, ssl.ca_filename), key: await getFileContents(bucketName, ssl.key_filename), cert:

Cannot connect to Google Cloud SQL using SSL + Golang from Google App Engine

旧街凉风 提交于 2020-01-11 10:16:00
问题 Google says you can connect to Google Cloud SQL using Golang and the go-sql-driver like so: import "database/sql" import _ "github.com/go-sql-driver/mysql" db, err := sql.Open("mysql", "user@cloudsql(project-id:instance-name)/dbname") ref: https://cloud.google.com/appengine/docs/go/cloud-sql/reference ... However, this (for me) generates a x509 certificate error: x509: certificate is valid for projectName:instanceName, not projectName I cannot figure out how to solve this. Adding the instance

Typical ormconfig.json file for Google Cloud SQL?

a 夏天 提交于 2020-01-11 09:56:07
问题 I have been trying for hours. What should be the ormconfig.json file for Google Cloud SQL working with TypeORM? I managed to get it working with the IP of the DB locally (with mysql workbench and Google cloud proxy and whitelisting my ip) but I don't know what the connection details should be for app engine. { "name": "default", "type": "mysql", "host": "/cloudsql/[project:region:instance]", "port": "3306", "username": "root", "password": "xxxx", "database": "yyy", "synchronize": true,

Can i use HikariCP on Google App Engine

眉间皱痕 提交于 2020-01-10 15:53:53
问题 Looking around for a connection pool solution on App Engine, with Cloud SQL, multiple entries show up with the suggestion that HikariCP should work because it allows for an external ThreadFactory configuration. For example; JDBC connection pool compatible with App Engine Connection pool on app engine with Cloud SQL The configuration would be something like this: import com.google.appengine.api.ThreadManager; ... HikariConfig lConfig = new HikariConfig(); config.setThreadFactory(ThreadManager

java.lang.IllegalStateException: Could not load JDBC driver class [com.mysql.jdbc.GoogleDriver]

旧巷老猫 提交于 2020-01-09 03:53:06
问题 I am trying to connect to my database from the Google Flexible Environment to the Google Cloud SQL . The connection string and the driver class are shown below: <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="com.mysql.jdbc.GoogleDriver" /> <property name="url" value="jdbc:google:mysql://mz-test:us-central1:mz-life-cloudsql-prod/mz_db" /> <property name="username" value="root" /> <property name="password" value

Error posting to URL: appengine.google.com/api/appversion/create - 404

萝らか妹 提交于 2020-01-06 19:53:16
问题 I have created a maven google app engine project from appengine-cloudsql-native-mysql-hibernate-jpa-demo-java. My project includes Rest webservices, Java, JPA and Hibernate. Locally everything (rest webservices and database connection) working perfect. But when I try to deploy my code ... I have a problem exactly same as Error posting to URL: appengine.google.com/api/appversion/create - 404. I tried all possible ways (enlisted in above link) to solve it but unable to solve it. Anybody can

No module named 'gcp_sql_operator' in cloud composer

梦想与她 提交于 2020-01-06 08:00:19
问题 I am not able to import statement as- from airflow.contrib.operators.gcp_sql_operator import CloudSqlQueryOperator I want to import this in my DAG file which will be run in cloud composer airflow whose version is 1.10.0 and not 1.9.0.Here just to check, I tried to import gcs_to_gcs as- from airflow.contrib.operators.gcs_to_gcs import GoogleCloudStorageToGoogleCloudStorageOperator I am able to import this but not gcp_sql_operator. 回答1: The CloudSqlQueryOperator operator is released since

First connect from Prestashop to Google Cloud SQL always fails

非 Y 不嫁゛ 提交于 2020-01-06 07:01:07
问题 I'm setting up a PrestaShop installation on a development server which is a GCE instance and using Cloud SQL as a database server. Everything works just fine except one thing: whenever there is a long period of inactivity on the site, the first page load after that always gives me this error: Link to database cannot be established: SQLSTATE[HY000] [2003] If I refresh the page the error is gone and never appears again until I stop using the site for an hour or so. It almost looks like database

Using Cloud SQL Proxy from Firebase function

折月煮酒 提交于 2020-01-06 04:29:06
问题 The bounty expires in 4 days . Answers to this question are eligible for a +100 reputation bounty. 1252748 is looking for a canonical answer . I'm running Google's Cloud SQL Proxy locally and it's working with locally served Firebase functions using a command like: /cloud_sql_proxy -instances=my-project-12345:us-central1:my-instance=tcp:1433 However I don't really know how to have this work on deployed Firebase functions. export const typeOrmConnectionOptions: ConnectionOptions = { name:

Reset pg_stat_statements with Google Cloud SQL

情到浓时终转凉″ 提交于 2020-01-04 06:52:49
问题 I am using a PostgreSQL instance running in Google Cloud SQL. I am trying to reset the pg_stat_statements because we made improvements to our tables and added some index. Unfortunately, when I try to run the following command using the main postgres user: select pg_stat_reset(); I get the following error message: ERROR: permission denied for function pg_stat_reset I understand that it's a managed service and some things need to be walled off, but it's important to be able to reset pg_stat so