我正面临着一个将我的MySQL数据库链接到Userfrosting的问题。本指南给出了一个向目录添加.enr文件的示例,以便用户可以读取数据库凭据,但它似乎不起作用。
有人能给我一个关于如何做到这一点的深入教程吗?
以下是运行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}发布于 2017-03-06 07:19:04
对于MAMP,需要将DB_HOST设置为127.0.0.1,而不是localhost。XAMPP的情况可能与此相同。已经有一个关于这个的开放拉取请求。参见https://github.com/userfrosting/UserFrosting/pull/659。
https://stackoverflow.com/questions/42612840
复制相似问题