laravel-blog: Illuminate\Database\QueryException

When I run $ docker-compose run --rm blog-server php artisan migrate , the first step of the ‘Before Starting’ section I get the following error message: Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = laravel-blog and table_name = migrations) at /application/vendor/laravel/framework/src/Illuminate/Database/Connection.php: 664

I’m using Valet.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 23 (13 by maintainers)

Most upvoted comments

Please try to ssh into docker and then run command composer dump

    $ composer dump

and clear config with below command

    $ php artisan config:clear 

and then check again it should work.

Result of running docker-compose up -d image mysql is definitely the culprit.

I don’t like the workarounds that much but PR are welcome.

To use it until the fix, just run docker-compose up -d before the migration