I Always use .env
file to define connection parameters to connect to mysql database.
This is connection Parameters:
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=lms-api
DB_USERNAME=lms_badpey
DB_PASSWORD=*********
I'm sure that all values is true because I used exactly those to login to phpmyadmin on the server But When make request to my app I got this error :
SQLSTATE[HY000] [1044] Access denied for user 'lms_badpey'@'localhost' to database 'lms-api' (SQL: select * from `users` where `email` = ahmad@gmail.com and `confirm` = 1 limit 1)
I tried that with new Database user But all have same results.
This problem is occured only on server and I have not this problem for localhost.
I am confused and I do not know where is problem and how to solve that.
Of Course I'm using Dingo larvel package that I do not think it's relevant.