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.

MySQL Error 1045 after transferring & renaming an account via WHM

Discussion in 'General Discussion' started by Winnie1874, Nov 5, 2013.

  1. Winnie1874

    Winnie1874 Registered

    Joined:
    Nov 5, 2013
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    I transferred an account from one VPS (VPS-OLD) to another (VPS-NEW) using the tools at:

    Home »Transfers »Copy an Account From Another Server

    There was an account on VPS-OLD that had the same name as one already existing on VPS-NEW; so as part of the transfer process I had to rename it using the Local User Name field.

    The account appeared to transfer fine, but when I attempt to log into a MySQL driven web application, I receive the following error message:

    Database connection failed. Error received from database was #1045: Access denied for user 'oldaccountname_webapp'@'localhost' (using password: YES).

    The page also displays the following non fatal error:

    SYSTEM WARNING: 'mysql_connect() [function.mysql-connect]: Access denied for user 'oldaccountname_webapp'@'localhost' (using password: YES)' in '/home/newaccountname/public_html/webapp/library/adodb/drivers/adodb-mysql.inc.php' line 365

    When checking the MySQL database and users on the transferred (renamed) account on VPS-NEW I see that both the database and usernames are prefixed by the newaccountname (as discussed above). There is no reference to the oldaccountname(s) in the database prefixes for the database name and user.

    The web application I am attempting to reach is somewhat critical so I would like to address this as quickly as possible and would greatly appreciate a (noob) step-by-step approach to resolving this issue. Thanks in advance for your help.

    Winnie
     
  2. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    You mast change database settings (database name and database user name) in your web application so that they match the new names.
     
  3. 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 :)

    Yes, the configuration file for your script/application needs to be modified with the new database name and database username details.

    Thank you.
     
  4. Winnie1874

    Winnie1874 Registered

    Joined:
    Nov 5, 2013
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you to both quietFinn and cPanelMichael for the replies. I have updated the application with the renamed database and user names (prefixes) and I am now able to access the application. I really appreciate the help.

    Winnie
     
Loading...

Share This Page