【问题标题】:SQLSTATE[HY000] [2002] Invalid argument (SQL: select * from information_sch ema.tables where table_schema = mamaput and table_name = migrations)SQLSTATE[HY000] [2002] 参数无效(SQL:select * from information_sch ema.tables where table_schema = mamaput and table_name = migrations)
【发布时间】:2018-11-05 12:18:40
【问题描述】:

我在我的虚拟专用服务器上设置了我的应用程序,并在放置我的配置文件后出现此错误

(2/2) QueryException
SQLSTATE[HY000] [2002] Invalid argument (SQL: select * from `categories` where 
`vendor_id` is null).

这是我的 .env 文件

APP_NAME=Mamaput
APP_ENV=production
APP_KEY=base64:oJ7frlsRiP5V5QuFKTwVgpoBkUDze6mZZLwawqgayHk=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://mama-put.com

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=mamaput
DB_USERNAME=root
DB_PASSWORD=B0j0p@l3

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

我已经很沮丧了,因为一切似乎都很好。我做错了什么?

【问题讨论】:

    标签: php mysql laravel-5 laravel-5.5


    【解决方案1】:

    通常意味着你需要指定 TCP/IP (1),或者告诉 MySQL 你的 Unix 套接字在哪里 (2):

    将本地主机更改为 127.0.0.1 要么 “mysql:host=127.0.0.1”或“mysql:host=localhost;port=3306” "mysql:unix_socket=/var/run/mysqld/mysqld.sock"

    【讨论】:

    • 哇,这对我有用!谢谢
    猜你喜欢
    • 2021-04-21
    • 2020-07-29
    • 2019-07-14
    • 2021-05-24
    • 2019-04-13
    • 1970-01-01
    • 2020-07-26
    • 2022-10-25
    • 1970-01-01
    相关资源
    最近更新 更多