Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

chask's avatar
Level 1

laravel deploy the project

how to solve this error SQLSTATE[HY000] [2002] Permission denied (SQL: select * from products) in laravel after uploading the project to server. i hope someone give me best solution.

0 likes
8 replies
shakti's avatar

can you show your env file

but before that try to change localhost to 127.0.0.1

hope it might help you

chask's avatar
Level 1

here is my env file

APP_NAME=Laravel APP_ENV=local APP_KEY=base64:7eLT+IZuYoMPQeyYa9BQ+yeB97ASG0oP8MbBWoW/A74= APP_DEBUG=true APP_LOG_LEVEL=debug APP_URL=http://localhost

DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=softweb_shop2 DB_USERNAME=softweb_shop2 DB_PASSWORD=shop123

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

REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379

MAIL_DRIVER=mailgun MAILGUN_DOMAIN=sandboxf925d7a49b074d388456833cc80a5ca5.mailgun.org MAILGUN_SECRET=key-74a9a68a804ab7196a000d129ad0e91d this is my env file

chask's avatar
Level 1

my laravel version is 5.3

chask's avatar
Level 1

i use besthost myanmar hosting this is the first time upload laravel project to server

MaverickChan's avatar
Level 47

never use that before , but after searching some informations , i just notice that they provides PgSql instead of MySql .

maybe this is the problem.

chask's avatar
Level 1

thanks for your information.

Please or to participate in this conversation.