简体   繁体   中英

Connect Google App Engine Eclipse Plugin to Cloud SQL

I'm having difficulties to connect Eclipse "Google App Engine" plugin to "Cloud SQL"

1) I have my instance created, up and running
2) I have my "App Engine" project allowed to use "Cloud SQL"
3) I set few remote IP to allow remote connection and currently trying to connect from permitted IP address
4) If I try to connect from "cmd" script - it works with authentication code from link
5) In Eclipse "Google App Engine" plugin I'm setting:

  • Instance name - which is full instance ID {app_id} : {db_id}
  • Database name - schema name in that instance which I create with "MySQL Workbench"
  • DB User name - root
  • Pass - blank

When I click ok, it give me following error:

Could not connect to Profile (<my eclipse servlet project name>.GoogleCloudSQL.DevInstance). 
Error creating SQL Model Connection connection to Profile 
(<my eclipse servlet project name>.GoogleCloudSQL.DevInstance). (Error: null)
java.lang.NullPointerException
OK

I'm not sure what am i doing wrong as error: "null" is not very informative :(
For example before when I was entering in instance ID just {db_id} without prefix of full app ID {app_id}:{db_id} it was clearly telling me that instance is wrong. Then when I misspell my db schema name - it also tells me that database with such name not found, but now everything looks correct, but still doesn't work and error is null

Could you please help me figure out how to connect this Eclipse Plugin?

Many THANKS in advance!!!

I see, that it is here for some time already... but I encountered this problem today. I do not know the root cause ;), but I resolved the problem simply by installing Eclipse DTP v. 1.7 .

Update site: Eclipse DTP update site .

Projects to install: "Data Tools Platform Enablement Extender SDK" and "Data Tools Platform Extender SDK".

My Eclipse version is 4.4.2. Now works like a charm :) Hope it helps!

Instead of connecting using instance name, you can get an IP address for the CloudSQL instance, and follow the code snippet from here.

https://developers.google.com/appengine/docs/java/cloud-sql/#connect_and_post

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM