google-cloud-sql

Connecting to Google Cloud SQL from Container Engine: can't resolve cloud sql proxy

↘锁芯ラ 提交于 2019-12-11 01:08:57
问题 I'm trying to connect to Google Cloud SQL from a node app, which is running in a Google Container Engine pod managed by Kubernetes. I've followed the instructions here to create a Cloud SQL proxy. When I run the app, I receive: { "code": "ENOTFOUND", "errno": "ENOTFOUND", "syscall": "getaddrinfo", "hostname": "127.0.0.1:3306", "host": "127.0.0.1:3306", "port": 3306, "fatal": true } So it looks as though the proxy can't be resolved. I've run kubectl describe pods <pod_name> and the proxy

Google Cloud SQL - ERROR 2003 (HY000): Can't connect to MySQL

独自空忆成欢 提交于 2019-12-10 19:17:55
问题 I am trying to connect my Google Cloud SQL using the command line. I can successfully connect when at home and I set a static IP address. However, I have to be on the road the next few days and I can't be at home. I am hoping to connect to mysql and make changes as needed on the server through the hotspot on my phone, but I would be happy with any type of internet connection working. How can I connect to my Google Cloud SQL even though I keep getting error as, ERROR 2003 (HY000): Can't

How can I set sql_mode to a list of values

℡╲_俬逩灬. 提交于 2019-12-10 18:43:46
问题 I am trying to use the 2nd gen cloud sql and would like to change the sql mode. In the UI, I can only set sql_mode to one value from a drop-down list, but not multiple of them (eg, "STRICT_MODE_TRANS,ALLOW_INVALID_DATES"). What would be the best way to accomplish that? Cheers, Andres 回答1: This is not supported right now by Google Cloud SQL. You can only set one value. 回答2: I know this post is 1 year old, but I stumbled upon this now when I had a problem with sql_mode when I tried migrating a

How to connect Google Cloud SQL from Google Container Engine?

老子叫甜甜 提交于 2019-12-10 18:14:54
问题 I am using Kubernetes to deploy a Rails application to Google Container Engine . The database is using Google Cloud SQL . I know the database's ip address and set it into my Kubernetes config file: # web-controller.yml apiVersion: v1 kind: ReplicationController metadata: labels: name: web name: web-controller spec: replicas: 2 selector: name: web template: metadata: labels: name: web spec: containers: - name: web image: gcr.io/my-project-id/myapp:v1 ports: - containerPort: 3000 name: http

Django on Google AppEngine with CloudSQL: How to connect database (Error 2002, Can't connect to local MySQL server..)

不羁岁月 提交于 2019-12-10 18:08:10
问题 I'm trying to start a Django app to be hosted on GAE, using CloudSQL. Locally, I'm on Mac OSX Maverics, working within a virtualenv (via virtualenvwrapper). After installing the GAE SDK for Python, I started my virtual environment, installed Django 1.5 from /usr/local/google_appengine/lib/django-1.5/ Also, on appengine.google.com I created a new app, and connected a CloudSQL instance to it (enable billing). I'm able to create a new Django project, e.g. django-admin.py startproject test01 ,

Google Cloud SQL Instance stuck at restarting

北城以北 提交于 2019-12-10 18:07:08
问题 My Google Cloud SQL Instance is stuck at restarting. The operations panel shows that the restart is running. I also can't access the backups or do anything else with the instance, because it is busy with restarting. Is there a way to get the server back up and running or access the backups so I can import the backups in a new sql instance? 来源: https://stackoverflow.com/questions/40808050/google-cloud-sql-instance-stuck-at-restarting

Google Cloud SQL stuck at restart

随声附和 提交于 2019-12-10 15:47:27
问题 My cloud sql instance is stuck in Restart sate for a very long time. In the operations pane, the status of the Restart is showing as pending, and there was also an export happening whose state is still Running . Is there an way i can force the restart or cancel the restart or recover the data from the regular backup ? 回答1: No, there is no way. If you pay Google for a premier account, you will be able to log a support ticket and they'll look into it and probably fix it. There's not many

ER_ACCESS_DENIED_ERROR CloudSQL

拈花ヽ惹草 提交于 2019-12-10 15:14:22
问题 I am receiving an error which looks like this (in my functions log) Access denied for user \'varun_admin\'@\'cloudsqlproxy~84.117.112.32\' (using password: YES)', sqlMessage: `\'varun_admin\'@\'cloudsqlproxy~84.117.112.32\' (using password: YES)',` sqlState: '28000', fatal: true } ( 84.117.112.32 ) intentionally modified. I have double checked my username and password , In fact, I made a request from workbench and it went fine. This is how I am creating/initialising my sql const mysql =

How can I apply aggregate functions to data extracted from JSON in Google BigQuery?

梦想的初衷 提交于 2019-12-10 13:47:25
问题 I am extracting JSON data out of a BigQuery column using JSON_EXTRACT . Now I want to extract lists of values and run aggregate functions (like AVG ) against them. Testing the JsonPath expression .objects[*].v succeeds on http://jsonpath.curiousconcept.com/. But the query: SELECT JSON_EXTRACT(json_column, "$.id") as id, AVG(JSON_EXTRACT(json_column, "$.objects[*].v")) as average_value FROM [tablename] throws a JsonPath parse error on BigQuery. Is this possible on BigQuery? Or do I need to

Kubernetes: stop CloudSQL-proxy sidecar container in multi container Pod/Job

我是研究僧i 提交于 2019-12-10 12:29:58
问题 I have a Kubernetes JOB that does database migrations on a CloudSQL database. One way to access the CloudSQL database from GKE is to use the CloudSQL-proxy container and then connect via localhost . Great - that's working so far. But because I'm doing this inside a K8s JOB the job is not marked as successfully finished because the proxy keeps on running. $ kubectrl get po NAME READY STATUS RESTARTS AGE db-migrations-c1a547 1/2 Completed 0 1m Even though the output says 'completed' one of the