I uploaded online all my prestashop website files and database but when I try to open the website I get this error “Link to database cannot be established: SQLSTATE[28000] [1045] Access denied for user 'lt27mhfc_dkddb'@'localhost' (using password: YES)"
.
I read somewhere on-line that when you upload the website files and the database the connection between those gets lost so I modified the setting.inc.php
file changing db_name, db_user, db_password
to match my new credentials.
I made a second new user and I choose a second new password and I even tried with those, the strange thing is that the message stays the same instead of saying “…for user newuser@’localhost’…”;
like I never changed the user and password the second time.
I am working online with cpanel.
Can anyone help?
3
Answers
so i solved it, i moved all the website files in the root folder which is "public_html" (it's not a must step, you can have those files where you want)
i modified these voices in the table ps_shop_url in the database connected to my website:
saved and now it works
Access denied error comes when the user do not have the access privileges set. If you are using cPanel then you can go to Database section and select Database Management and add a user to database and provide all privileges, and then try if it works.
Different websites provide different methods to provide access, try the below one if it could help
For example, if you have a user named “misty” and database named “snowcones”, you would grant misty privileges to the database by doing the following:
user from the first dropdown menu and the database from the second (in this case, “misty” and “snowcones”)
Prvileges” to grant all of them.
If you ever need to modify privileges for a user already associated with a database, find the section labelled “Current Databases” and click on the username next to the database in question. It will then give you the same privileges page on which you can revoke or grant privileges simply by checking the boxes.
For reference click here
I also get this a lot of time when I upload a new website. One method I tried and worked is that you add a port after the host. like
Try it and tell if it works