Laravel 迁移 Postgres 错误

5

你好,我想将Laravel与PostgreSQL数据库连接起来。

当我运行以下命令时:

php artisan migrate

它给我返回了这个错误。

[Illuminate\Database\QueryException]                                                                                                                                                    
SQLSTATE[08006] [7] expected authentication request from server, but received J (SQL: select * from information_schema.tables where table_schema = public and table_name = migrations)  



[Doctrine\DBAL\Driver\PDOException]                                              
SQLSTATE[08006] [7] expected authentication request from server, but received J  

你找到任何解决方案了吗?我也遇到了同样的问题。 - Serj.by
不要@Serj.by,我已经转移到了MySQL,如果你找到解决方案,请告诉我。 - PULL STACK DEV
3个回答

6
对我来说问题在于我忘记将端口从3306更改为5432。

1
请检查您输入的 pgsql 数据库凭据是否正确。
谢谢!

1

请检查以下文件:
.env
config/database

您是否正确填写了以下信息:

DB_CONNECTION=
DB_HOST=
DB_PORT=
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=

以及

'default' => env('DB_CONNECTION', 'pgsql'),


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接