3

I'm setup homestead in my pc then i'm try to access my files via local domain. But when i'm trying to connect with DB then showing me this error. I can't access my others projects too. I setup everything very well. But i don't know why showing me this error.

Note: I'm using windows 8.1

Here is my setup code:

  1. Homestead.yaml

ip: "192.168.10.10"

memory: 2048

cpus: 1

provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:

- ~/.ssh/id_rsa

folders:

- map: F:/xampp/htdocs/Projects
  to: /home/vagrant/Projects

sites:

- map: govt-university.dev
  to: /home/vagrant/Projects/govt-university/public

- map: voyager.dev
  to: /home/vagrant/Projects/voyager/public

- map: evaluationplus.dev
  to: /home/vagrant/Projects/laravel-evaluationplus/public

- map: laravel-university.dev
  to: /home/vagrant/Projects/laravel-evaluationplus/public

databases: - homestead


  1. Host file

    192.168.10.10 govt-university.dev
    
    192.168.10.10 voyager.dev
    
    192.168.10.10 evaluationplus.dev
    
    192.168.10.10 laravel-university.dev
    

  1. ENV file

    APP_NAME= Laravel

    APP_ENV=local

    APP_KEY=base64:nmcR0V2cbq+26H3EBdLmYRQN5bkiOryROTxHpvUzuvA=

    APP_DEBUG=true

    APP_LOG_LEVEL=debug

    APP_URL=http://voyager.dev

    DB_CONNECTION=mysql

    DB_HOST=127.0.0.1

    DB_PORT=3306

    DB_DATABASE=voyager

    DB_USERNAME=homestead

    DB_PASSWORD=secret


Error Image: enter image description here

Please help me to solve this problem. Thanks

Mirza Obaid
  • 1,707
  • 3
  • 23
  • 35
MD Iyasin Arafat
  • 763
  • 1
  • 12
  • 22

2 Answers2

1

You need to ssh into Vagrant and then run artisan command to migrate database. Once you do this will be fixed.

Manzurul
  • 633
  • 6
  • 11
  • 1
    Hi Manzurul, Thanks for your ans. Wow that's it, after running 'php artisan migrate' commend into Vagrant ssh then errors are gone. Would you describe me why this happening Please... – MD Iyasin Arafat Oct 06 '17 at 03:45
  • 1
    Vagrant use virtualbox to setup the development environment which is why it create the mysql server inside its container which can be accessed via ssh. It also mounts your project directory to its server www/htdocs/your-project folder too. Thats why artisan migrate command in your local directory wont migrate database because the environment vagrant created is fully isolated from your local machine. I hope its clear. – Manzurul Oct 06 '17 at 10:30
-1

Have you tried

php artisan migrate
Mark Walker
  • 1,199
  • 11
  • 20