1

我在将我的 MySQL 数据库链接到 Userfrosting 时遇到问题。该指南提供了一个将.enr文件添加到目录的示例,以便 Userfrosting 可以读取数据库凭据,但它似乎不起作用。

有人可以给我一个关于如何做的深入教程吗?

这是运行时的错误代码install.php

Could not connect to the database '@/'.  Please check your database
configuration and/or google the exception shown below:
  Exception: SQLSTATE[HY000] [2002] No such file or directory
  Trace:
    #0 /Applications/XAMPP/xamppfiles/htdocs/myUserFrostingProject/migrations/install.php(63): PDO->__construct('mysql:host=;dbn...', NULL, NULL)
    #1 {main}
4

1 回答 1

1

对于 MAMP,DB_HOST需要设置为127.0.0.1而不是 localhost。XAMPP 的情况可能与此相同。已经有一个关于此的公开拉取请求。请参阅https://github.com/userfrosting/UserFrosting/pull/659

于 2017-03-05T23:19:03.740 回答