| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
This sample demonstrates how to use Cloud SQL on Google Managed VMs.
Before you can run or deploy the sample, you will need to do the following:
Create a Second Generation Cloud SQL instance. You can do this from the Cloud Console or via the Cloud SDK. To create it via the SDK use the following command:
$ gcloud sql instances create YOUR_INSTANCE_NAME \
--activation-policy=ALWAYS \
--tier=db-n1-standard-1
Set the root password on your Cloud SQL instance:
$ gcloud sql instances set-root-password YOUR_INSTANCE_NAME --password YOUR_INSTANCE_ROOT_PASSWORD
Use the MySQL command line tools (or a management tool of your choice) to create a new user and database for your application:
$ mysql -h [IP Address of database] -u root -p mysql> create database YOUR_DATABASE; mysql> create user 'YOUR_USER'@'%' identified by 'PASSWORD'; mysql> grant all on YOUR_DATABASE.* to 'YOUR_USER'@'%';
Set the connection string environment variable in src/main/appengine/app.yaml
$ mvn clean jetty:run
$ mvn clean gcloud:deploy
| Back | FazBrowse Home | New Git URL |