laravel与gcloud读取副本套接字返回文件未找到

时间:2017-05-21 18:26:49

标签: php laravel-5.4 google-cloud-sql

我使用gcloud app引擎来部署laravel,并使用cloud sql来部署数据库。之后我添加了read-replica。

database.php中

'driver' => 'mysql',
        'read' => [
            'host' => env('DB_HOST_READ', env('DB_HOST', '127.0.0.1')),
            'unix_socket' => env('DB_SOCKET_READ', env('DB_SOCKET', '')),
        ],
        'write' => [
            'host' => env('DB_HOST_WRITE', env('DB_HOST', '127.0.0.1')),
            'unix_socket' => env('DB_SOCKET_WRITE', env('DB_SOCKET', '')),
        ],

的app.yaml

DB_HOST_READ: 'localhost'
DB_SOCKET_READ: '/cloudsql/my-app-engine:asia-northeast1:cloudsql-db-read'
DB_HOST_WRITE: 'localhost'
DB_SOCKET_WRITE: '/cloudsql/my-app-engine:asia-northeast1:cloudsql-db'

我收到了错误 SQLSTATE [HY000] [2002]没有这样的文件或目录。

我正在做这件事吗?

0 个答案:

没有答案