Website inaccessible after a database password reset

更新时间:
复制 MD 格式

After resetting your database password in the virtual host management console, your Web Hosting website may become inaccessible. This issue occurs if the new password is not also updated in your website's database connection configuration file. Follow the steps in this topic to resolve the problem.

Symptoms

After resetting the database password in the virtual host management console, your website may become inaccessible and display a database connection error.

Cause

Resetting the database password in the virtual host management console does not automatically update the password in your website's database connection configuration file. You must manually update the configuration file with the new password.

Solution

  1. Use an FTP client to download your website's files to your on-premises host.

    In this example, the website's files are stored in the E:\www directory on the on-premises host.

  2. Open Command Prompt on your on-premises host.

    1. Press the Win+R keys.

    2. In the Run dialog box, enter cmd in the Open field.

    3. Click OK.

  3. Run the following command to switch to the root directory E:\.

    e:
  4. Run the following command to switch to the E:\www directory.

    cd www
  5. Run the following command to find the database connection configuration file.

    findstr /s /i "your_database_name" *.*

    In this example, the command output identifies common.inc.php as the database connection configuration file:

    C:\Users\Administrator>e:
    E:\>cd www
    E:\www>findstr /s /i "xxx_db" *.*
    data\common.inc.php:$cfg_dbname = 'xxx_db';
    E:\www>
  6. Change the database password in the configuration file to match the new password from the virtual host management console, then save the file.

    You can use a text editor such as EditPlus to open the database connection configuration file (common.inc.php).

  7. Upload the modified database connection configuration file to your website's root directory.

    For more information, see Upload website files to a Linux-based virtual host or Upload website files to a Windows-based virtual host.

  8. Access your website again.

    • If your website loads as expected, the issue is resolved.

    • If the website is still inaccessible, submit a ticket for assistance.