I feel like I'm so close. I've finally got my app deploying to Cloud Run from Github without ever really learning Docker. It's exposed and I can connect to it. It deploys with every commit. Remarkable!
The issue is the connection to my Google SQL instance with a database named laravel and a new user (not root).
Desperate for help. Like, "Ready to go to Fiverr" desperate. I just need this unfathomably large architecture to run my silly tiny Laravel checklist webapp. Am I too dumb to use an "unmanaged" server?
Things I've Tried
- I can connect via Cloudshell using the new user
- I added Run Admin, SQL Client, Editor, and Service Account User roles to my IAM Compute default service account, which seems important
- I left the SQL Instance -> Authorized Networks empty so the SQL Proxy can connect
- I've tried change DB_HOST to
localhost and the public IP address of the SQL instance
- ChatGPT, Google quickstart articles, searching Laracasts forums
- Watching the Codejet and Techguy videos
I use the Environment Variables section of the Cloud Run revision to set these values. Am I missing a required value?
APP_NAME=Appname
APP_ENV=prod
APP_KEY=base64:longstringhere
APP_DEBUG=true
APP_TIMEZONE=UTC
APP_URL=http://customdomain.com
APP_LOCALE=en
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=sail
DB_PASSWORD=password
There is an option at the bottom to use the SQL instance, which should automatically set up Cloud SQL Auth Proxy
Cloud SQL connections
Cloud SQL instance 1
appname-123456:us-central1:appname
Illuminate \ Database \ QueryException PHP 8.3.6. Laravel 11.0.8
SQLSTATE[HY000] [2002] Connection refused
select * from `sessions` where `id` = sessionidhere limit 1