google-cloud-sql

CloudSQL PDO(unix_socket) problems on Google App Engine

末鹿安然 提交于 2019-12-06 08:11:44
I'm trying to connect to my CloudSQL instance FROM App Engine. The way I've set it up is to use a static IP, which I can use to connect to it from outside App Engine (namely, on my development environment). However, when the app runs within GAE, the only way to connect to the database is using unix_socket. The only documentation I've found on this is Google's own docs . According to the documentation, this should be enough to connect: $db = new PDO('mysql:unix_socket=/cloudsql/my-prj:db1;charset=utf8', '<username>', '<password>' ); I am able to connect to the database using the root password I

Error with Maven GAE Plugin + Google Cloud SQL

跟風遠走 提交于 2019-12-06 08:10:19
Here's my plugin configuration: <plugin> <groupId>net.kindleit</groupId> <artifactId>maven-gae-plugin</artifactId> <version>0.7.3</version> <dependencies> <dependency> <groupId>net.kindleit</groupId> <artifactId>gae-runtime</artifactId> <version>${gae.version}</version> <type>pom</type> </dependency> </dependencies> <configuration> <jvmFlags> <jvmFlag>-Drdbms.server=local</jvmFlag> <jvmFlag>-Drdbms.driver=com.mysql.jdbc.Driver</jvmFlag> <jvmFlag>-Drdbms.url=jdbc:mysql://localhost:3306/prova?user=root&password=pass</jvmFlag> </jvmFlags> <serverId>appengine.google.com</serverId> </configuration>

Why is Google Appengine so slow connecting to CloudSQL

喜夏-厌秋 提交于 2019-12-06 07:55:10
问题 I am seeing a drastic difference in latency between development and production when connecting to a CloudSQL backend, much more so than I would expect. I ran a test where: I fetched 125, 250, 500, 1000 and 2000 rows (row size approximately 30bytes) I fetched each row size 20 times, to get a good sampling of the time The test was run in three environments: Hosted appengine Development mode locally, but connecting to CloudSQL via static IP Development mode locally and connecting to a local VM

Could not connect to Google cloud SQL. Using PHP Google SDK

我们两清 提交于 2019-12-06 07:46:00
I did read this tutorial https://developers.google.com/appengine/docs/php/cloud-sql/ I had created a Instance with name schoolnbd and my project id is myapplication-2013 After reading the tutorial I tried the code below <?php $dhost=":/cloudsql/myapplication-2013:schoolnbd"; $duser="root"; $dpassword="xxxyyy"; $database="schoolnbd"; $connection=mysql_connect($dhost, $duser, $dpassword) or die("Could not Connect to SQL Server Suleman"); $db=mysql_select_db($database, $connection) or die(" Check the Database Name from Config.php , wrong database entered "); ?> But it is showing “Could not

“Authorisation is required to perform that action” message, even after clicking “Allow”

戏子无情 提交于 2019-12-06 07:26:45
问题 I've recently run into an issue authorising a new Google App Script project, specifically one using the Cloud SQL admin API. The same code exists in previously authorised GAS projects and works fine, but if I take a copy of the GAS project and try to run a function for the first time I'm unable to complete the authorisation process. The screens I'm going through are listed below: Authorisation Required. - clicked "Review Permissions" Choose an account to authorise the Google project. -

Authorized GAE applications must be in the same region as the database instance | Google App engine

送分小仙女□ 提交于 2019-12-06 06:37:54
问题 Unable to Connect to the cloud sql | Google App engine | Authorized GAE applications must be in the same region as the database instance error. I did read this tutorial https://developers.google.com/appengine/docs/php/cloud-sql/ I tried to give my appID to Storage>>cloudsql>>Authorized App Engine Applications, but it shows me this Authorized GAE applications must be in the same region as the database instance. 回答1: Go to the cloud sql console at: https://console.developers.google.com/project/

Kubernetes can not mount a volume to a folder

扶醉桌前 提交于 2019-12-06 06:35:49
问题 I am following these docs on how to setup a sidecar proxy to my cloud-sql database. It refers to a manifest on github that -as I find it all over the place on github repos etc- seems to work for 'everyone' but I run into trouble. The proxy container can not mount to /secrets/cloudsql it seems as it can not succesfully start. When I run kubectl logs [mypod] cloudsql-proxy : invalid json file "/secrets/cloudsql/mysecret.json": open /secrets/cloudsql/mysecret.json: no such file or directory So

Run Alembic migrations on Google App Engine

[亡魂溺海] 提交于 2019-12-06 02:55:26
问题 I have a Flask app that uses SQLAlchemy (Flask-SQLAlchemy) and Alembic (Flask-Migrate). The app runs on Google App Engine. I want to use Google Cloud SQL. On my machine, I run python manage.py db upgrade to run my migrations against my local database. Since GAE does not allow arbitrary shell commands to be run, how do I run the migrations on it? 回答1: Whitelist your local machine's IP: https://console.cloud.google.com/sql/instances/INSTANCENAME/access-control/authorization?project=PROJECTNAME

Could not create socket factory 'com.google.cloud.sql.mysql.SocketFactory;'

♀尐吖头ヾ 提交于 2019-12-06 01:05:12
I can't seem to get this to work .. I am using Google Flexible Environment and want to connect to my Second Generation Cloud SQL database. I am currently getting this exception: [main] ERROR com.mahlzeit.server.BootstrappingServerConfig - Error trying to migrate SQL scripts .. org.flywaydb.core.api.FlywayException: Unable to obtain Jdbc connection from DataSource at org.flywaydb.core.internal.util.jdbc.JdbcUtils.openConnection(JdbcUtils.java:56) at org.flywaydb.core.Flyway.execute(Flyway.java:1385) at org.flywaydb.core.Flyway.migrate(Flyway.java:1006) ... Caused by: com.mysql.jdbc.exceptions

SSL self-signed certifications to connect with Mysql with PHP

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 00:50:26
问题 Summary: PHP gives an error when using self-signed certificates as provided by Google Cloud SQL. Details: I am trying to connect to Google Cloud SQL's mysql instance using PHP's mysqli library. $db = mysqli_init(); mysqli_options ($db, MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, true); $db->ssl_set('client-key.pem', 'client-cert.pem', 'server-ca.pem', NULL, NULL); $query = mysqli_real_connect ($db, $host, $user, $pass, $dbname, 3306, NULL, MYSQLI_CLIENT_SSL); As I understand Google cloud allows self