2017-03-12 9 views
0

私は同じプロジェクトのApp EngineからCloud SQLにアクセスしています。 rootユーザーにパスワードを設定しました。私はリモートでthusly mysqlコマンドラインから接続することができるよ:Google Cloud SQL:App Engineからのアクセスが拒否されました

C:>mysql -u root -h xxx.xxx.xxx.xxx -p <- IP address of my Cloud SQL 
Enter password: <--- I supply passw0rd 
Welcome to the MySQL monitor. Commands end with ; or \g. 
Your MySQL connection id is 20913 
Server version: 5.7.14-google-log (Google) 

しかし、私はApp Engineのからしようとすると:

コードスニペット:

url = "jdbc:google:mysql://myproject:us-central1:myinst/mydb?user=root;password=passw0rd"; 
conn = (Connection) DriverManager.getConnection(url); 

私が手にエラーがある:

com.google.gae.server.Connect getConnection: ERROR. Could not get connection. Access denied for user 'root;password=passw0rd'@'cloudsqlproxy~xxx.xxx.xxx.xxx' (using password: NO) 

私はただのユーザーだけでURLを試しましたが、運はありません。
ご意見をお待ちしております。

答えて

0

私のエラーが見つかりました。 Java URLは、次のとおりです。

url = "jdbc:google:mysql://myproject:us-central1:myinst/mydb?user=root&password=passw0rd"; 

私はを置き換えました。&
現在動作しています。

+0

ya、GETリクエストクエリのパラメータは、 '&' not ';'と組み合わせる必要があります。 –

関連する問題