google-cloud-sql

How to run Google Cloud SQL only when I need it?

元气小坏坏 提交于 2020-05-14 03:43:18
问题 Google Cloud SQL advertises that it's only $0.0150 per hour for the smallest machine type, and I'm being charged for every hour, not just hours that I'm connected. Is this because I'm using a pool? How do I setup my backend so that it queries the cloud db only when needed so I don't get charged for every hour of the day? const mysql = require('mysql'); const pool = mysql.createPool({ host : process.env.SQL_IP, user : 'root', password : process.env.SQL_PASS, database : 'mydb', ssl : {

How to connect to Cloud SQL MySQL database from App Engine?

自古美人都是妖i 提交于 2020-05-13 19:28:42
问题 I am currently setting up an open-source marketing software called Mautic on App Engine Flexible Environment. However, I'm having trouble with connecting the App Engine to the Cloud SQL MySQL database using MySQLi. Mautic is a PHP application built on top of Symfony. I tried using /cloudsql/< instance_connection_name > as the host, but it didn't work. Does anyone have any experience with deploying Mautic on App Engine or know to address this problem? 回答1: CONNECTING FROM APP ENGINE (FLEX AND

Can't import PostgreSQL10 dump into 9.6 database

耗尽温柔 提交于 2020-05-07 10:20:27
问题 I need to somehow convert a v10 dump file into one which is 9.6 compatible Google's Cloud SQL runs PostgreSQL version 9.6 and my database has been running on version 10 since its creation. THE ISSUE : When trying to import the database into Cloud SQL, I get the an unknown error has occurred. message of death. I have already tried commenting out my postgis / other extensions when importing to Cloud SQL but, to no avail. I have tried using using psql my_96_db < my_10.sql and get tons of errors

How could I import google analytics data to Google Cloud Platform?

烈酒焚心 提交于 2020-05-02 04:43:37
问题 I need to import data from Google Analytics to Google Cloud Platform (Cloud Storage maybe) and then process this information and exported to google cloud SQL. I have not a clear idea what Google Cloud Service I can use to run the process of importing the data. I was thinking to use Google DataFlow to do the Extraction Transformation and Load into Cloud SQL . 回答1: As @jkff mentioned in the comments if you have Google Analytics 360 you can enable the bigQuery integration and your raw data will

Serverless VPC Access Connectors - Unable to connect to cross region network resource

给你一囗甜甜゛ 提交于 2020-04-17 22:12:15
问题 I am trying to connect Cloud SQL Server from Cloud Function. My Cloud SQL Server exists in asia-south1 region and that region doesn't have support for deploying Cloud Functions. So, I created and deployed Cloud Function in asia-east2 region and trying to connect to SQL Server using private IP as instructed at this link: https://cloud.google.com/vpc/docs/configure-serverless-vpc-access. All resources are in same VPC and facing Connection Timeout error. I also observed that if both SQL Server

Serverless VPC Access Connectors - Unable to connect to cross region network resource

微笑、不失礼 提交于 2020-04-17 22:11:51
问题 I am trying to connect Cloud SQL Server from Cloud Function. My Cloud SQL Server exists in asia-south1 region and that region doesn't have support for deploying Cloud Functions. So, I created and deployed Cloud Function in asia-east2 region and trying to connect to SQL Server using private IP as instructed at this link: https://cloud.google.com/vpc/docs/configure-serverless-vpc-access. All resources are in same VPC and facing Connection Timeout error. I also observed that if both SQL Server

Permissions For Google Cloud SQL Import Using Service Accounts

ぐ巨炮叔叔 提交于 2020-04-10 18:20:47
问题 I've exported MySQL Database following the MySQL Export Guide successfully. Now, I'm trying to import MySQL Database following the MySQL Import Guide. I've checked the permissions for the service_account_email I'm using, and I have allowed both Admin SQL and Admin Storage permissions. I was able to successfully activate my service account using this command locally: gcloud auth activate-service-account <service_account_email> --key-file=<service_account_json_file> After I ran the command:

Connect local Laravel environment to Google Cloud SQL - MySQL

僤鯓⒐⒋嵵緔 提交于 2020-03-25 19:04:48
问题 I try to connect my Laravel project into my local development environment to Google Cloud SQL (MySQL). For this, I connected from my OSX Terminal with the Cloud SQL-Proxyclient to the remote database with port 3307. I can connect with my MySQL Workbench to the remote database, and I can see/change tables, ... Into my Laravel project into .env I changed the settings: DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3307 DB_DATABASE=mydatabasename DB_USERNAME=mydatabaseusername DB_PASSWORD

Accessing Cloud SQL from another GCP project

随声附和 提交于 2020-03-18 09:47:08
问题 I want to connect to Cloud SQL from a different GCP project. Cloud SQL is location in ProjectSQL and a VPC network is there in ProjectSQL project with name sql_vpc There is another project ProjectDataflow and this has a vpc dataflow_vpc. I want to connect to cloudSQL from ProjectSQL with the VM launched in ProjectDataflow project Things I have tried with success and failure. Private ACCESS: VPC Peering: Enable Private IP access in Cloud with the vpc sql_vpc Creating VPC peering between

Not able to connect app engine to cloud sql for mysql instance

限于喜欢 提交于 2020-03-04 15:33:41
问题 sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'localhost' ([Errno 2] No such file or directory)") (Background on this error at: http://sqlalche.me/e/e3q8) Its been long time i am stuck at this error , I am trying to connect my app engine python code to a cloud sql for mysql instance. This is the first time i am working with google cloud.below is the code i have written 1. in app.yaml runtime: python37 vpc_access_connector: name: