I am trying to deploy my laravel project to 000webhost. The problem is I can not connect to my database.
When I set my DB_HOST to 127.0.0.1 I get an "SQLSTATE[HY000] [2002]" error mentioned. When I change DB_HOST to localhost I get an error saying "wrong com stmt prepare response size received 7".
This is my .env file:
APP_ENV=local
APP_DEBUG=true
APP_KEY=base64:fuFWdq2OAIZbxiiouYdTfbPnkeEOL8h/hDJjvb7XT+c=
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=id1619178_kule
DB_USERNAME=************
DB_PASSWORD=************
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=mail
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=tls
MAIL_TO=