The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SQL database can't be accessed, despite there being a user with granted permissions.

Discussion in 'General Discussion' started by joshglen, Mar 31, 2016.

  1. joshglen

    joshglen Registered

    Joined:
    Mar 31, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    I have been trying to transfer over a website that uses prestashop from my hosting provider to cpanel on another provider, and to a different domain.
    I believe I have set up everything correctly, however when the website
    loads, all it says is
    Link to database cannot be established: SQLSTATE[HY000] [1045] Access denied for user '(username)'@'(ip address)' (using password: YES)
    However, I am positive that I added the correct user username and password, and have granted them all the permissions to settings.inc.php. I am using the settings.inc.php file from the old one, just modified. The original file had a database server that was not localhost, however when I changed it to localhost it just redirected me to the old site on the old domain (that is still being hosted on aplus.net).

    I am not really sure what to do, so any help would be appreciated.
     
    #1 joshglen, Mar 31, 2016
    Last edited by a moderator: Mar 31, 2016
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Are you sure the file you are editing is intended for the database login information? If so, try using a test script with those same MySQL login details to verify it's working:

    Script for a quick PHP MySQL DB connection test. · GitHub

    Thank you.
     
  3. joshglen

    joshglen Registered

    Joined:
    Mar 31, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    How do I use the script? I know I have to upload it to ftp, but where should I upload it to and how should I use it?
    Thanks for any help that can be provided.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    It's simply a test script to verify your database login details are accurate. You can either paste the CODE into a new PHP file under public_html in File Manager, or upload it via FTP. Then, just edit the file via File Manager with your own database login details, and open it in your web browser to see if it successfully connects.

    Thank you.
     
  5. joshglen

    joshglen Registered

    Joined:
    Mar 31, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Neither the ftp nor the cpanel file manager gives me the option to open it. How should I go about doing that?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page