Laravel Homestead Vagrant Box Database Problems

后端 未结 7 2262
轮回少年
轮回少年 2020-12-30 17:11

I can\'t use the same database.php settings when browsing the local website in a browser (example.app:8000) and when using php artisan migrate.

If my database.php se

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-30 17:41

    In homestead, MySQL is configured to bind to the VM's 10.x.x.x address, and does not bind to 127.0.0.1

    You can change this by editing /etc/mysql/my.cnf and adding the line:

    bind-address = 0.0.0.0

    This will allow you to use 127.0.0.1 in your database configuration for both web and CLI use of the database.

提交回复
热议问题