SQLSTATE[HY000] [2002] Invalid argument (SQL: select * from information_sch ema.tables where table_schema = mamaput and table_name = migrations)

烈酒焚心 提交于 2021-01-28 13:53:10

问题


I set up my app on my virtual private server and after putting up my configuration file i get this error

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

Here is my .env file

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

I am already frustrated cos everything seems okay. What am i doing wrong?


回答1:


Usually means that you need to specify TCP/IP (1), or tell MySQL where your Unix socket is (2):

change localhost to 127.0.0.1 or "mysql:host=127.0.0.1" or "mysql:host=localhost;port=3306" "mysql:unix_socket=/var/run/mysqld/mysqld.sock"



来源:https://stackoverflow.com/questions/50540375/sqlstatehy000-2002-invalid-argument-sql-select-from-information-sch-ema

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!