How to do it...

The implementation approach would be to first create the backend service (the database), then the instance-related setup, and finally the load balancing setup:

  1. Let's first create a Cloud SQL instance. On the Google Console, navigate to the SQL menu item under Storage.
  2. Click on Create instance and select MySQL.
  3. Choose the recommended MySQL second generation and fill out the details:
The root password is set to a simple password for demonstration purposes.
  1. Note the IP address of the Cloud SQL instance that will be fed to the configuration file in the next step:
  1. Navigate to the /Chapter01/php-app/pdo folder. Edit the config.php ...

Get Google Cloud Platform Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.