After Changing the MySQL Password, 114la Cannot Connect to the Database

After Changing the MySQL Password, 114la Cannot Connect to the Database

After changing the MySQL password, if 114la reports that it cannot connect to the database, the program itself is usually not broken. In most cases, the database password saved in the site's configuration file has simply not been updated.

The file path to check is:

/admin/config/cfg_database.php

Open this file and find the database connection settings, for example:

$GLOBALS['database']['db_user'] = '114la_open'; // 数据库用户名
$GLOBALS['database']['db_pass'] = '114la_open'; // 数据库密码
$GLOBALS['database']['db_name'] = '114la_open'; // 数据库名
$GLOBALS['database']['db_host'] = 'localhost';  // 数据库地址

Manually update the corresponding fields according to the database information provided by your hosting provider or server control panel:

  • db_user: database username
  • db_pass: the new database password
  • db_name: database name
  • db_host: database host address. A common value is localhost, but it may also be an internal network address or domain name provided by the hosting provider

After making the change, save the file, then refresh the 114la admin panel or homepage. If it still cannot connect, continue checking the following items:

  1. Confirm that the new MySQL password has taken effect.
  2. Confirm that the database username and database name have not been entered in reverse.
  3. Confirm that the database host address is not some other address specified by the hosting provider.
  4. Confirm that the quotation marks and semicolons in the configuration file have not been accidentally deleted.
  5. If the server has caching or PHP process caching, restart the relevant services and test again.

In general, after entering the correct information provided by the hosting provider into cfg_database.php, the database connection should be restored.

Leave a Reply