I\'m on a Mac OS Yosemite using Laravel 5.0.
While in my local environment, I run php artisan migrate
I keep getting :
i using laravel 5.* i figure i have a file call .env
in the root of the project that look something like this:
APP_ENV=local
APP_DEBUG=true
APP_KEY=SomeRandomString
DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
And that was over writing the bd configuration so you can wheather deleted those config vars so laravel take the configuration under /config or set up your configuration here.
I did the second and it works for me :)
i have find solution
Go to your application root directory and open .env file (In ubuntu may be it’s hidden so press ctrl+h to show hidden files) in your editor and change database configuration setting. then save your .env file
then restart your apache server/web server. and refresh your page and you have done
This worked for me gl ...
You have to run the $ php artisan migrate
command from within Homestead, not your Mac.
If you are using the PHP's default web server (e.g. php artisan serve
) you need to restart your server after changing your .env file values.
Sometime in the future. Try to clear your config first
php artisan config:clear.
Close all the terminal /cmd windows and then restart terminal/CMD and this should get rid of the error message. See if it works.
When you install Homestead, this creates a default "homestead" database in the VM. You should SSH into the VM
homestead ssh
and run your migrations from there. If you are working locally with no VM, you'll need to create your database manually. By default, the database should be called homestead, the username is homestead and the password is secret.
check this thread on laracasts or this blog post for more details
if you are getting
[PDOException] SQLSTATE[HY000] [2002] No such file or directory
try changing "host" in the /app/config/database.php file from "localhost" to "127.0.0.1" . you can find more details and other fixes here on this thread.
Also check whether you have specified the correct unix_socket
. check this thread .