title: How do I connect to Cloud SQL from a Laravel project running on Cloud Run?
body: <p>for a proof of concept project, I'm trying to connect my Laravel project running on a fully-managed <code>Cloud Run</code> with <code>Cloud SQL</code> as storage layer.</p>
  <p>I've managed to get a functioning service through Google App Engine using the <code>gcloud app engine</code> command (this service could connect to the storage layer). I've also connected successfully with the storage layer through a <code>cloud_sql_proxy</code> and a local docker container of my service. But I can't manage to get a setup working remotely with Cloud Run.</p>
  <p>I'm deploying the docker image as follows:</p>
  <pre><code>gcloud run deploy --image eu.gcr.io/demo/customerservice --add-cloudsql-instances demo:europe-west1:dps-demo --update-env-vars INSTANCE_CONNECTION_NAME=&quot;demo:europe-west1:dps-demo
  </code></pre>
  <p>The error my service returns for requests is:</p>
  <pre><code>could not find driver (SQL: select * from `cache` where `key` = laravel_cachefa9d927c88ff8ebffd06913d97f9d59e limit 1)
  </code></pre>
  <p>(This error happens for any type of database queries and is similar if I'm using a local cache)</p>
  <p>This is my <code>.env</code> file (I removed some clutter unrelated to the problem):</p>
  <pre><code>APP_NAME=Laravel
  APP_ENV=local
  APP_KEY=***
  APP_DEBUG=true
  APP_URL=http://CustomerService.test
  APP_STORAGE=/tmp
  
  
  LOG_CHANNEL=stack
  LOG_LEVEL=debug
  
  DB_CONNECTION=mysql
  DB_HOST=127.0.0.1
  DB_PORT=3306
  DB_DATABASE=laravel
  DB_USERNAME=root
  DB_PASSWORD=***
  DB_SOCKET=/cloudsql/demo:europe-west1:dps-demo
  
  BROADCAST_DRIVER=log
  CACHE_DRIVER=database
  QUEUE_CONNECTION=sync
  SESSION_DRIVER=database
  SESSION_LIFETIME=120
  
  VIEW_COMPILED_PATH=/tmp
  </code></pre>