Illuminate \ Database \ QueryException:SQLSTATE [HY000] [2002] php_network_getaddresses:getaddrinfo failed:提供nodename或servname,或者不知道

我正在处理我的Laravel项目,并在运行PHP artisan migrate时保留以下错误。 我在我的Mac上使用Xampp。 </ p>


Illuminate \ Database \ QueryException:</ p>

SQLSTATE [HY000] [2002] php_network_getaddresses:getaddrinfo failed:
nodename还是servname 已提供或未知</ p>
</ blockquote>

Mysql数据库正在此URL上运行: http:// localhost:8080 / phpmyadmin / </ code> </ p >

我附上 .env </ code>文件。</ p>

任何人都可以帮忙解释一下这个错误以及如何解决这个问题吗?</ p>

 <代码> APP_NAME = Laravel 
APP_ENV =本地
APP_KEY = BASE64:WlwOxBC4RITPMvG6OHy9aacUszgqSvf0szSzmLzS8nE =
APP_DEBUG =真
APP_URL = HTTP://本地主机

LOG_CHANNEL =栈

DB_CONNECTION = MySQL的
DB_HOST = 8080 / phpmyadmin的
DB_PORT = 3306
DB_DATABASE = laravelwebsite
DB_USERNAME =根
DB_PASSWORD = 123456

BROADCAST_DRIVER = LOG
CACHE_DRIVER =文件
QUEUE_CONNECTION =同步
SESSION_DRIVER =文件
SESSION_LIFETIME = 120

REDIS_HOST = 127.0 .0.1
REDIS_PASSWORD = NULL
REDIS_PORT = 6379

MAIL_DRIVER = SMTP
MAIL_HOST = smtp.mailtrap.io
MAIL_PORT = 2525
MAIL_USERNAME = NULL
MAIL_PASS WORD = NULL
MAIL_ENCRYPTION =空

PUSHER_APP_ID =
PUSHER_APP_KEY =
PUSHER_APP_SECRET =
PUSHER_APP_CLUSTER = MT1

MIX_PUSHER_APP_KEY = “$ {PUSHER_APP_KEY}”
MIX_PUSHER_APP_CLUSTER = “$ {PUSHER_APP_CLUSTER}”
</代码> </ pre>
</ div>

展开原文

原文

I'm currently working on my Laravel project and I keep the error below while running PHP artisan migrate. I'm using Xampp on my mac.

Illuminate\Database\QueryException :

SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known

Mysql database is running on this url: http://localhost:8080/phpmyadmin/

I attach my .env file.

Can anyone can help to explain this error and how to fix the problem?

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:WlwOxBC4RITPMvG6OHy9aacUszgqSvf0szSzmLzS8nE=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=8080/phpmyadmin
DB_PORT=3306
DB_DATABASE=laravelwebsite
DB_USERNAME=root
DB_PASSWORD=123456

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

dousu8767
dousu8767 8080/phpmyadmin不是主机名,请尝试使用localhost。phpmyadmin不是数据库,它是用于管理数据库的网页。
接近 2 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐