0

I'm using Laravel 5.3, and 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

If I try to connect to the server through MySQL Workbench, it connects fine.

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??

user86516512
  • 101
  • 1
  • There is no table `migrations` in your database `db`. Were you expecting such a table to exist? – Michael Hampton Jul 11 '20 at 22:06
  • `php artisan migrate` I believe is supposed to create the table – user86516512 Jul 11 '20 at 22:11
  • Note that these tutorials are community driven and may contain some errors. If you believe the steps therein are not working as they should I would suggest reporting them to their [Github Page](https://github.com/GoogleCloudPlatform/community/issues/new?title=Issue%20with%20tutorials/run-laravel-on-appengine-standard/index.md&body=Issue%20Description) so that either the creator or the community could investigate. – Happy-Monad Jul 13 '20 at 09:32
  • I will do that, if I find an answer. – user86516512 Jul 14 '20 at 15:53
  • Bump? Help me please – user86516512 Aug 04 '20 at 16:52
  • Bumping this again – user86516512 Sep 28 '20 at 03:17
  • ErrorException in Connection.php line 770: SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from `settings`) (View: /home/sriabt/appoets-tranxit/resources/views/admin/auth/login.blade.php) – Biene Technologies Feb 17 '21 at 16:25

0 Answers0