Skip to content
Advertisement

SQLSTATE[HY000] [2002] No such file or directory when i try to php artisan migrate

Just made a new laravel project and tried to migrate the tables and i got this :

SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = sugarDaddy and table_name = migrations and table_type = ‘BASE TABLE’)

I tried clearing the cache, the routes, the config, and changing the DBHOST from 127.0.0.1 to localhost and back as i saw in a few articles on so, but nothing worked. i’ll leave here the migration and an ss to the database.

JavaScript
JavaScript

the database ss

Advertisement

Answer

I can see from the screenshot that your phpMyAdmin is connecting to the database at 8889 port, your env has DB_PORT=3306, change to DB_PORT=8889.

Summary of the comment section:

Dan is using MAMP, so the config for mysql connection should contain (for default MAMP settings):

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement