skip to Main Content

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


  1. Chosen as BEST ANSWER

    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:

    • domain: www.example.com
    • domain ssl: www.example.com
    • phisical uri: the name of the foler in which you have your website; mine was the root folder so i wrote "/"

    saved and now it works


  2. 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:

    • Login to cPanel and navigate to the “Databases” section
    • Click “MySQL Databases”
    • Scroll down to the section labeled “Add User to Database” Select the
      user from the first dropdown menu and the database from the second (in this case, “misty” and “snowcones”)
    • Click “Add”
    • Select the privileges you want to grant to the user or select “All
      Prvileges” to grant all of them.
    • Click “Make Changes” to finalize it.

    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

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

    define('_DB_SERVER_', 'localhost:3306');
    

    Try it and tell if it works

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