简体   繁体   English

Aqueduct 执行数据库迁移文件失败

[英]Aqueduct failed to execute db migration file

I'm trying to learn Dart and Aqueduct.我正在尝试学习 Dart 和 Aqueduct。 I'm following the Aqueduct tutorial.我正在关注 Aqueduct 教程。 Up to now everything worked ok.到目前为止一切正常。 But when connecting to the database I get an error.但是当连接到数据库时,我得到一个错误。

I'm using:我在用着:

Windows 10
PostreSQL 13
Dart 2.10.0
Aqueduct 4.0.0-b1

I get the following error:我收到以下错误:

*** There was an error connecting to the database 'heroes_user:password@localhost:5432/heroes'. Reason: unable to connect to database.

Command prompt with error命令提示符有错误

命令提示符有错误

I can connect to the database using psql or DBeaver , so username (heroes_user), password (password) and database (heroes) are correct.我可以使用psqlDBeaver连接到数据库,因此用户名 (heroes_user)、密码 (password) 和数据库 (heroes) 都是正确的。

I started with Aqueduct 3, but after I search for the error I noticed other people had similar problems and the suggestion was to upgrade to Aqueduct 4. So I executed pug get + updated pubspec.yaml + pub global activate aqueduct 4.0.0-B1 .我从 Aqueduct 3 开始,但在搜索错误后,我注意到其他人也有类似的问题,建议是升级到 Aqueduct 4。所以我执行了 pug get + updated pubspec.yaml + pub global activate aqueduct 4.0.0-B1 . This did not result in any progress.这并没有带来任何进展。

Other suggestions I found were to change the password authentication method.我发现的其他建议是更改密码验证方法。 I modified pg_hba.conf to include the line:我修改了pg_hba.conf以包含以下行:

host    all             all             127.0.0.1/32            md5 

But this did not have any success either.但这也没有任何成功。

I'm not sure in which direction to search anymore.我不确定该往哪个方向搜索了。 I've noticed similar questions, but without actual answers.我注意到类似的问题,但没有实际答案。 Any suggestions?有什么建议么?

Solved.解决了。 Problem seemed to be with PostgreSQL 13. I installed PostgreSQL 12.4 and ran the command to create the database migration file.问题似乎出在 PostgreSQL 13 上。我安装了 PostgreSQL 12.4 并运行了创建数据库迁移文件的命令。 Then ran the database update command and it worked immediately.然后运行数据库更新命令,它立即工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM