diff --git a/appengine/cloudsql/README.md b/appengine/cloudsql/README.md index 1c01860847d..f2c6a3c623a 100644 --- a/appengine/cloudsql/README.md +++ b/appengine/cloudsql/README.md @@ -7,14 +7,20 @@ Before you can run or deploy the sample, you will need to create a [Cloud SQL in 1. Create a new user and database for the application. The easiest way to do this is via the [Google Developers Console](https://console.cloud.google.com/sql/instances). Alternatively, you can use MySQL tools such as the command line client or workbench. 2. Change the root password (under Access Control) and / or create a new user / password. -3. Create a Database (under Databases) (or use MySQL with `gcloud sql connect --user=root`) +3. Create a Database (under Databases) (or use MySQL with `gcloud beta sql connect --user=root`) 4. Note the **Instance connection name** under Overview > properties (It will look like project:instance for 1st Generation or project:region:zone for 2nd Generation) +or + +```bash +gcloud sql instances describe | grep connectionName +``` + ## Deploying ```bash -$ mvn clean appengine:deploy -DINSTANCE_CONNECTION_NAME=instanceConnectionName -Duser=root +$ mvn clean appengine:update -DINSTANCE_CONNECTION_NAME=instanceConnectionName -Duser=root -Dpassword=myPassword -Ddatabase=myDatabase ``` @@ -23,7 +29,7 @@ Or you can update the properties in `pom.xml` ## Running locally ```bash -$ mvn clean appengine:run -DINSTANCE_CONNECTION_NAME=instanceConnectionName -Duser=root -Dpassword=myPassowrd -Ddatabase=myDatabase +$ mvn clean appengine:devserver -DINSTANCE_CONNECTION_NAME=instanceConnectionName -Duser=root -Dpassword=myPassowrd -Ddatabase=myDatabase ``` Note - you must use a local mysql instance for the 1st Generation instance and change the local Url in `src/main/webapp/WEB-INF/appengine-web.xml` to use your local server. diff --git a/appengine/cloudsql/pom.xml b/appengine/cloudsql/pom.xml index 3eca56527ae..7ef9d29cdf7 100644 --- a/appengine/cloudsql/pom.xml +++ b/appengine/cloudsql/pom.xml @@ -58,8 +58,16 @@ com.google.appengine appengine-api-1.0-sdk + ${appengine.sdk.version} + + com.google.api-client + google-api-client-appengine + 1.21.0 + + + mysql @@ -93,18 +101,18 @@ + com.google.appengine appengine-maven-plugin ${appengine.sdk.version} - -->