问题
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