google-cloud-sql

How to connect to Google Cloud SQL with go-sql-driver/mysql on App Engine?

不羁的心 提交于 2019-12-02 05:12:08
I'm using the go-sql-driver/mysql driver in Go on App Engine to connect to a Cloud SQL instance like this: import ( "database/sql" _ "github.com/go-sql-driver/mysql" ) db, dbErr := sql.Open("mysql", "root@cloudsql(project:instance)/database" ... pingErr := db.Ping() but I get " permission denied " in pingErr . Of course, I've checked my app is authorized in the Cloud SQL console under "Access Control" per the docs . I also tried adding a MySQL user with privileges and using user:password in place of root and even not specifying a user. What am I doing wrong? ... Update: Per @Kyle's suggestion

How to pass the password of an database in a non-interactive way for gcloud CLI?

巧了我就是萌 提交于 2019-12-02 02:45:05
问题 I am trying to pass the password to gcloud sql connect command in a non-interactive way. What I want to achieve is not being asked for password, but pass it in the command somehow. Not sure if it's possible, based on documentation, but on the other hand it's something very useful to automate tasks, I strongly believe that there is a way to do it... The command: gcloud sql connect <database_name> --user=<user_name> 回答1: gcloud sql connect provides "sugar" to facilitate connecting to Cloud SQL

How to use GCP Cloud SQL as Dataflow source and/or sink with Python?

折月煮酒 提交于 2019-12-01 23:50:22
问题 Is there any guidance available to use Google Cloud SQL as a Dataflow read source and/or sink? At the Apache Beam Python SDK 2.1.0 documentation there isn't a chapter mentioning Google Cloud SQL. But there is written about BigQuery. And as I read tutorial Performing ETL from a Relational Database into BigQuery, I saw that they used exported data to file as a source in the process. That means there has to be an export step in between and that't not ideal. Are there specific issues you need to

Connecting Google Cloud SQL with Wordpress on Google Compute Engine

自古美人都是妖i 提交于 2019-12-01 23:50:12
I've been running a successful Wordpress install on Google Compute Engine with Nginx, Php-fpm and Mysql. I noticed you can also run Wordpress on App Engine with a Cloud SQL connection as mentioned here https://developers.google.com/appengine/articles/wordpress?hl=en I want to use Wordpress on Compute Engine with the db running on Cloud SQL. On AppEngine, you need to put the following lines in the wp-config.php file if(isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'],'Google App Engine') !== false) { define('DB_HOST', ':/cloudsql/YOUR_PROJECT_ID:wordpress_db_name');F

Typical ormconfig.json file for Google Cloud SQL?

丶灬走出姿态 提交于 2019-12-01 22:30:36
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, "logging": false, "entities": [ "modules/**/*.entity.js" ] } or { "name": "default", "type": "mysql", "extra"

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

非 Y 不嫁゛ 提交于 2019-12-01 21:29:50
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 name again (even though it's already there) in the connection string does not help, nor is correct

Google Cloud Composer and Google Cloud SQL

和自甴很熟 提交于 2019-12-01 18:06:11
What ways do we have available to connect to a Google Cloud SQL (MySQL) instance from the newly introduced Google Cloud Composer? The intention is to get data from a Cloud SQL instance into BigQuery (perhaps with an intermediary step through Cloud Storage). Can the Cloud SQL proxy be exposed in some way on pods part the Kubernetes cluster hosting Composer? If not can the Cloud SQL Proxy be brought in by using the Kubernetes Service Broker? -> https://cloud.google.com/kubernetes-engine/docs/concepts/add-on/service-broker Should Airflow be used to schedule and call GCP API commands like 1)

Google Cloud Composer and Google Cloud SQL

无人久伴 提交于 2019-12-01 16:23:50
问题 What ways do we have available to connect to a Google Cloud SQL (MySQL) instance from the newly introduced Google Cloud Composer? The intention is to get data from a Cloud SQL instance into BigQuery (perhaps with an intermediary step through Cloud Storage). Can the Cloud SQL proxy be exposed in some way on pods part the Kubernetes cluster hosting Composer? If not can the Cloud SQL Proxy be brought in by using the Kubernetes Service Broker? -> https://cloud.google.com/kubernetes-engine/docs

access denied (“java.lang.RuntimePermission” “modifyThreadGroup”)

£可爱£侵袭症+ 提交于 2019-12-01 11:56:57
I'm developing a server application using Google App Engine and Google Cloud SQL. I have a problem when trying to connect to the Cloud SQL when running the server on my local machine. I get the error: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThreadGroup") Here is the servlet code: package com.example.example; import com.google.appengine.api.utils.SystemProperty; import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import javax.servlet.http.*; public class

Importing Data to Google Cloud SQL via CSV

元气小坏坏 提交于 2019-12-01 11:15:51
Google Cloud SQL restricts use of LOAD DATA INFILE in SQL statements. I'm trying to make a feature that would allow users to batch upload user data to my web app so they don't have to make each entry one by one. How would I go about accomplishing this within the restrictions of GAE PHP and Cloud SQL ? Update: Users of my app are able to manage a list of students. I want my users to be able to submit a CSV file and have that input into their student database. I can't use sync or MySQL workbench, etc. It has to be done within the web app. Thanks for your input! I too was recently looking for a