skip to Main Content

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:

enter image description here

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


  1. 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

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search