微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

php – 如何在Laravel Homestead中使用postgreSQL

我可以迁移到我的家园.
这是我的.env
DB_CONNECTION=pgsql
DB_HOST=localhost
DB_PORT=54320
DB_DATABASE=intern
DB_USERNAME=homestead
DB_PASSWORD=secret

我在postgresql中创建了一个新的服务器

server name = Homestead,username = homestead,password = secret.

然后,我做了迁移,并将所有表创建到我的数据库中(server = homestead)
问题是,当我想在我的网站上登录时.它发生错误

sqlSTATE[08006] [7] Could not connect to server: Connection refused↵  
Is the server running on host "localhost" (::1) and accepting↵  
TCP/IP connections on port 54320?↵Could not connect to server: Connection refused↵  
Is the server running on host "localhost" (127.0.0.1) and accepting↵  
TCP/IP connections on port 54320? (sql: select * from "users" where "email" = user@gmail.com limit
您的端口末尾有一个额外的0.将DB_PORT = 54320更改为DB_PORT = 5432

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。