I have been trying to connect the MySQL on google cloud for Laravel application, i have configured the app.yaml file as per the documents featured on internet. But don't know whats wrong with GCloud, it won't connect anyway.
Can someone please help me.
runtime: php
env: flex
runtime_config:
document_root: public #folder where index.php is
# Ensure we skip ".env", which is only for local development
skip_files:
- .env #we want to skip this to make sure we don’t mess stuff up on the server
env_variables:
# Put production environment variables here.
APP_ENV: production
APP_DEBUG: true
APP_KEY: base64:5efXAk7MFz9HoBbRP55vxgu6eu+sFeBEOp/lhHzXc6s=
#go to generate app key paragraf in this tutorial
CACHE_DRIVER: file
# instead of putting the cache in the database I recommend using redis
SESSION_DRIVER: file
APP_LOG: daily
#APP_TIMEZONE: UTC #your timezone of choice
# follow the part of the tutorial on setting up your SQL database
DB_CONNECTION: mysql
DB_HOST: localhost
DB_DATABASE: submit_itr_v1
DB_USERNAME: root
DB_PASSWORD: somepassword
DB_SOCKET: "/cloudsql/<Instance connection name>"
DB_PORT: 3306
STORAGE_DIR: /tmp
MYSQL_DSN: "mysql:dbname=db_name;unix_socket="/cloudsql/intance-connection-name"
MYSQL_USER: root