Getting an error on the command: php artisan migrate
This is the message that I am getting:
[Illuminate\Database\QueryException]
SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = blog_
testing and table_name = migrations)
[PDOException]
SQLSTATE[HY000] [2002] No such file or directory
I am using the "Laravel 5.4 from Scratch" tutorial, Episode 22: Testing 101. I am encountering this problem when having 3.29 minutes left on the video.
Yikes! I just deleted all of the tables from my non test database and tried to migrate. I am getting the same error message:
[Illuminate\Database\QueryException]
SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = projLearn and table_name = migrations)
[PDOException]
SQLSTATE[HY000] [2002] No such file or directory
@visheshchanana if you mean literally creating the database, I'd suggest the app Sequel Pro if you're on macOS or something like it if you're on Windows.
SANTI1111 is correct. I spent a couple of hours trying every possible suggested fix on the internet, and nothing had worked until I looked at the DB_PORT in the .env file. Wamperver was using 3308 instead of the default 3306. I was FINALLY usable to get php artisan migrate to run!
I've tried everything. No luck. php artisan migrate gives me ` Illuminate\Database\QueryException
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for database failed: Name or service not known (Connection: mysql, SQL: select table_name as name, (data_length + index_length) as size, table_comment as comment, engine as engine, table_collation as collation
@brockness That is a completely different issue, in a different environment. Please create a separate thread for your question, rather than digging up a six year old, unrelated question.