I am trying to publish my website through cpanel. when I run the web url of my site, it gives the error Access denied for user ‘root’@’localhost’ and my .env file is given below
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:wwuqMKOwBR67OJgHY76xAxEFbCqyKTE/Fd1T25Xfjg8=
APP_DEBUG=true
APP_URL=http://salonfurnisher.co.uk/public/
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=ew3tfqy9_myproject
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=[REDACTED]
MAIL_PASSWORD=[REDACTED]
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=[REDACTED]
MAIL_FROM_NAME="Saloon Furnisher"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
How I can solve this?
2
Answers
You have to grant all permission your database like the picture
Try to connect to DB with other client (Mysql developer). Make sure db exists. Make sure you are connecting to the right mysql server, not mixing it like vagrant with xampp or wamp (if you have more than one installed).