I created a database, User and password on cpanel. I’ve written down the username, password and database that i’ve created, in my env file:
But every time I try to load my website page it says, "SQLSTATE[42000] [1044] Access denied for user ‘cobaognm_cobary’@’localhost’ to database ‘cobaognm_cobary’".
Normally, in my experience, when I’ve used "cpanel", in the past, I’ve never had to do more than this.
But I find myself stuck. What can I do next?
I’ve gone online and I’ve tried other solutions on Stack Overflow, regarding a similar problem. But nothing has worked for me, so far. The error has persisted.
2
Answers
Did you linked the user to that database?
In cPanel, when you create a new database and an user, you should add the permissions for that user on your database.
https://support.cpanel.net/hc/en-us/articles/360057550753-How-to-create-a-database-and-database-user-in-cPanel
Try to go to the database settings and modify the user settings and give him all the permissions to make sure that you did it well. Go to phpmyadmin and try logging in with it and verify the permissions.