This sample demonstrates how to use Cloud SQL on Google App Engine
Before you can run or deploy the sample, you will need to create a Cloud SQL instance)
- Create a new user and database for the application. The easiest way to do this is via the Google Developers Console. Alternatively, you can use MySQL tools such as the command line client or workbench.
- Change the root password (under Access Control) and / or create a new user / password.
- Create a Database (under Databases) (or use MySQL with
gcloud beta sql connect <instance> --user=root) - 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
gcloud sql instances describe <instance> | grep connectionName$ mvn clean appengine:update -DINSTANCE_CONNECTION_NAME=instanceConnectionName -Duser=root
-Dpassword=myPassword -Ddatabase=myDatabaseOr you can update the properties in pom.xml
$ mvn clean appengine:devserver -DINSTANCE_CONNECTION_NAME=instanceConnectionName -Duser=root -Dpassword=myPassowrd -Ddatabase=myDatabaseNote - 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.