本文介绍了PDOException:SQLSTATE [HY000] [2002]没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将PushChatServer目录放在htdocs文件夹中,并创建数据库puschat尝试运行@" http://localhost/PushChatServer/api/test/database.php "

I have put PushChatServer dir in htdocs folder and create database puschat try to run @"http://localhost/PushChatServer/api/test/database.php"

然后我得到以下例外情况.

Then I got following exception.

我想做同样的事情来解释此链接 http://www.raywenderlich.com/32963/apple-push-notification-services-in-ios-6-tutorial-part-2

I want do same thing to explain this link http://www.raywenderlich.com/32963/apple-push-notification-services-in-ios-6-tutorial-part-2

我已经做了所有的事,但是我得到了这个例外

I have done all that but I got this exception

推荐答案

您需要将主机从localhost更改为127.0.0.1

You need to change host from localhost to 127.0.0.1

Laravel 4:在您的app/config/database.php中,尝试将主机从localhost更改为127.0.0.1

Laravel 4: In your app/config/database.php try changing host from localhost to 127.0.0.1

Laravel 5:在.env文件中,将DB_HOSTlocalhost更改为127.0.0.1

Laravel 5: In the .env file, change DB_HOST from localhost to 127.0.0.1

来源: PDOException SQLSTATE [HY000] [2002]没有这样的文件或目录

这篇关于PDOException:SQLSTATE [HY000] [2002]没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 00:03