-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update SQL 1. Use filtering to set variables. 2. Update README I was unable to get SQL proxy working so we can’t really do IT testing yet.
- Loading branch information
Showing
3 changed files
with
63 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,25 @@ | ||
# Cloud SQL sample for Google App Engine | ||
This sample demonstrates how to use [Cloud SQL](https://cloud.google.com/sql/) on Google App Engine | ||
|
||
## Setup | ||
Before you can run or deploy the sample, you will need to create a [Cloud SQL instance](https://cloud.google.com/sql/docs/create-instance) | ||
1. Create a new user and database for the application. The easiest way to do this is via the [Google Developers Console](https://console.developers.google.com/project/_/sql/instances/example-instance2/access-control/users). Alternatively, you can use MySQL tools such as the command line client or workbench. | ||
Before you can run or deploy the sample, you will need to create a [Cloud SQL instance)](https://cloud.google.com/sql/docs/create-instance) | ||
|
||
1. Create a new user and database for the application. The easiest way to do this is via the [Google | ||
Developers Console](https://console.developers.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 <instance> --user=root`) | ||
4. Note the **Instance connection name** under Overview > properties | ||
(It will look like project:instance for v1 or project:region:zone for v2) | ||
|
||
## Deploying | ||
|
||
`$ mvn clean appengine:deploy -DINSTANCE_CONNECTION_NAME="instanceConnectionName" -Duser=root | ||
-Dpassword=myPassword -Ddatabase=myDatabase` | ||
|
||
Or you can update the properties in `pom.xml` and | ||
|
||
## Running locally | ||
1. You will need to be running a local instance of MySQL. | ||
1. Update the connection string in ``appengine-web.xml`` with your local MySQL instance values. | ||
<br/>`$ mvn clean appengine:devserver` | ||
|
||
## Deploying | ||
1. Update the connection string in ``appengine-web.xml`` with your Cloud SQL instance values. | ||
<br/>`$ mvn clean appengine:update` | ||
`$ mvn clean appengine:run -Duser=root -Dpassword=myPassowrd -Ddatabase=myDatabase` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters