Laravel .env设置

时间:2016-02-22 07:52:35

标签: php laravel vagrant homestead

我现在使用Laravel已经有一段时间了,但每次我想要迁移时,我都必须将ViewModel更改为DB_HOST然后如果我想看到我的网络应用程序,我有将其更改回127.0.0.1否则会抛出异常:

localhost

我使用宅基地这是我的homestead.yaml文件:

PDOException in Connector.php line 55:
SQLSTATE[HY000] [2002] Connection refused

我的--- ip: "192.168.10.10" memory: 2048 cpus: 1 provider: virtualbox authorize: ~/.ssh/id_rsa.pub keys: - ~/.ssh/id_rsa folders: - map: ~/Code to: /home/vagrant/Code sites: - map: website.dev to: /home/vagrant/Code/website/public databases: - homestead 文件:

/hosts/etc

当我收到# Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost 192.168.10.10 website.dev 时,我收到了:

localhost

我真的需要解决这个问题。请帮忙!

1 个答案:

答案 0 :(得分:0)

数据库用户必须拥有localhost127.0.0.1的权限。我很确定它现在只有localhost。