I’ve been literally working on this for 6 hours without any updates.
It’s my first time creating anything aware typical VPS and I’m using GCP to create my platform on Laravel, so, let me explain the best I can:
I’ve got a Laravel platform uploaded to cloud run and I’m trying to use the SQL for the databases needed by Laravel.
The point is, I can’t do it.
I think I tried it all but let me give you info. This is all my environment variables
Name | Value |
---|---|
APP_KEY | base64:dfadsfasdfafdasdfasfdasfdasfdasfd/MQ= |
LOG_CHANNEL | stderr |
LOG_LEVEL | debug |
DB_CONNECTION | mysql |
DB_PORT | 3306 |
DB_DATABASE | realnameofmydatabase |
DB_USERNAME | realnameofmyusername |
DB_PASSWORD | realpassword |
DB_SOCKET | /cloudsql/stagingapp-132131231:europe-southwest1:realend |
and this is part of my database.php
:
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', ''),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', ''),
'username' => env('DB_USERNAME', ''),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => env('DB_CHARSET', 'utf8mb4'),
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
The weirdest part? I can connect with THE SAME DB_DATABASE, DB_USERNAME & DB_PASSWORD from localhost using the public IP like 34.123.123.123 instead DB_SOCKET
Attach a screenshot of general view of my cloud run. Anything will be really helpful. Thanks you so very much.
UPDATE: More info, this is the last log I recieved: Cloud SQL connection failed. Please see https://cloud.google.com/sql/docs/mysql/connect-run for additional details: certificate had CN "", expected "stagingapp-123123123:realend"