Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php SQLSTATE[HY000][2002]参数无效(SQL:select*from information_sch ema.tables,其中table_schema=mamaput和table_name=migrations)_Php_Mysql_Laravel 5_Laravel 5.5 - Fatal编程技术网

Php SQLSTATE[HY000][2002]参数无效(SQL:select*from information_sch ema.tables,其中table_schema=mamaput和table_name=migrations)

Php SQLSTATE[HY000][2002]参数无效(SQL:select*from information_sch ema.tables,其中table_schema=mamaput和table_name=migrations),php,mysql,laravel-5,laravel-5.5,Php,Mysql,Laravel 5,Laravel 5.5,我在我的虚拟专用服务器上设置了我的应用程序,在设置了配置文件后,出现了此错误 (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:oJ7frlsRiP5V5QuFKTwVgpoBk

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

(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

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

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

将localhost更改为127.0.0.1 或 “mysql:host=127.0.0.1”或“mysql:host=localhost;port=3306”
“mysql:unix_socket=/var/run/mysqld/mysqld.sock”

waow这是为我做的!谢谢