samedi 4 juillet 2020

Can't run migrations in Google Cloud SQL

I'm using Laravel 5.3, following this tutorial to get myself set up with Google Cloud:

https://cloud.google.com/community/tutorials/run-laravel-on-appengine-standard

I'm at the part where I'm trying to run my database migrations, so I do:

export DB_DATABASE=db DB_USERNAME=root DB_PASSWORD=<my_db_password> DB_SOCKET="<my_connection_name>"
php artisan migrate --force

But I get the following output in my terminal:

[Illuminate\Database\QueryException]
SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from inform
ation_schema.tables where table_schema = db and table_name = migrations)

[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY000] [2002] No such file or directory

[PDOException]
SQLSTATE[HY000] [2002] No such file or directory

Here is my app.yaml file (I removed sensitive information):

runtime: php72

runtime_config:
    document_root: public

env_variables:
    APP_LOG: errorlog
    # Application key
    APP_KEY: <my_app_key>
    # Storage path
    APP_STORAGE: /tmp
    VIEW_COMPILED_PATH: /tmp
    CACHE_DRIVER: database
    SESSION_DRIVER: database
    # Database configuration
    DB_CONNECTION: mysql
    DB_SOCKET: "/cloudsql/<my_connection_name>"
    DB_HOST: 127.0.0.1
    DB_PORT: 3306
    DB_DATABASE: db
    DB_USERNAME: root
    DB_PASSWORD: <my_db_password>

beta_settings:
    cloud_sql_instances: "<my_connection_name>"

I also tried changing 127.0.0.1 to localhost, but I get the same error.

What am I doing wrong??



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire