【发布时间】:2014-01-20 12:30:18
【问题描述】:
我在应用程序引擎中编写了一个 java servlet,我正在尝试连接到云 sql,我正在 windows 上的 eclipse kepler 中工作。在我已通过应用程序授权访问数据库的谷歌云控制台中,它们都存储在美国。
要在 Eclipse 中为我的应用启用云 sql,我将进入 google>app engine settings...
我尝试配置云 sql 实例,我正在使用适当的实例名称:并且我指定了正确的数据库名称用户名和密码,我也尝试使用空白密码,并且空白密码和用户 niether 都有工作。此外,我在我的数据库和应用程序引擎和 Eclipse 中使用相同的电子邮件帐户。我收到的错误是:
Could not connect to Profile (<project>.GoogleCloudSQL.AppEngineInstance).
Error creating SQL Model Connection connection to
Profile(<project>.GoogleCloudSQL.AppEngineInstance). (Error: Not authorized to access
instance: <instance:database>)
Not authorized to access instance: <instance:database>
Error creating Google Cloud SQL Connection factory connection to Profile
(<project>.GoogleCloudSQL.AppEngineInstance). (Error: Not authorized to access
instance: <instance:database>)
Not authorized to access instance: <instance:database>
然后我尝试使用 appengine sdk 的 bin 文件夹中提供的 google_sql.sh 脚本测试数据库。我将我发送到一个 url 以获取授权码,在输入授权码后,我刚刚获得脚本失败,说明“提供的授权授权无效、过期、撤销等”。
我只希望我的应用程序引擎 java servlet 能够访问我的云 sql 数据库...有人有什么建议吗?一个解法?类似的问题?
【问题讨论】:
-
有关我尝试过的更多详细信息,请参阅此帖子:stackoverflow.com/questions/20896237/…
标签: java eclipse google-app-engine google-cloud-sql