1

Im using Mac os x Yosemite 10.10. I installed the lastest laravel version 5.1. I set up Homestead and it has been running great. However, when I try to make a MySQL connection in my Laravel app, and am now experiencing errors when running php artisan migrate on my development machine. Following is the statement that I see when I run php artisan migrate.

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

How can I solve this problem? When I get into VM, mysql works fine. But I do not know how I can use php artisan migrate. Thank you in advance.

Best

Galma88
  • 2,398
  • 6
  • 29
  • 50
Wooyoung Jung
  • 17
  • 1
  • 3
  • possible duplicate of [Setting up Laravel on a Mac php artisan migrate error: No such file or directory](http://stackoverflow.com/questions/19475762/setting-up-laravel-on-a-mac-php-artisan-migrate-error-no-such-file-or-directory) – cjds Jul 02 '15 at 15:23
  • Hi. Since I'm using Homestead, the link you have offered is not working for me. Thanks anyway! – Wooyoung Jung Jul 02 '15 at 15:30
  • My mistake. Didn't see that . – cjds Jul 02 '15 at 15:32

2 Answers2

2

check mysql server is available or not and check database.php with proper sql driver path for database.php

  project/config/database.php

check your .env file in project directory and check DB details

DB_HOST=localhost
DB_DATABASE=dbname
DB_USERNAME=username
DB_PASSWORD=password
Vivek Chaudhari
  • 1,930
  • 1
  • 14
  • 20
0

Take a look at your .env file (root directory) and check twice your connections. ex:

DB_HOST=localhost
DB_DATABASE=dbname
DB_USERNAME=username
DB_PASSWORD=password
MGoebelM
  • 11
  • 1
  • 4