Database Errors

From WHMCS Documentation

You may see the following errors when working with databases:

Down for Maintenance - An upgrade is currently in progress

This error indicates that the version of WHMCS's files does not match the version of your database. For example, you may have uploaded files for WHMCS 8.6 but, because the upgrade script has not run, the database is still set up for WHMCS 8.5.

To resolve this, upload the current version's WHMCS files again and perform the upgrade process. After the upgrade, you will be able to access the system again.

For more information, see Updating and Troubleshooting a Down for Maintenance Error while Updating WHMCS.

Critical Error - Unable to connect to the database

This error indicates that the system cannot connect to your database. Check and update the database connection details in the configuration.php file. For example, you may need to make corrections if you recently changed the password or renamed the database itself. This could also be an issue with MySQL® or an empty configuration.php file.

If you have confirmed that the database name, username, and password are correct, make certain that the MySQL user is assigned to the desired database and has full access. For help, contact your hosting provider or system administrator.

You may receive this error if your server requires encrypted MySQL connections (--require_secure_transport is ON in the server configuration).

  • In WHMCS 8.7 and earlier, you *cannot* use encrypted MySQL connections and must update the server's settings.
  • In WHMCS 8.8 and later, you must update the configuration.php file before you can successfully use encrypted connections. For more information, see System Environment Guide and Enabling Encrypted MySQL Connections.

Critical Error - Could not connect to the database

This error indicates that the system cannot connect to your database. Check and update the database connection details in the configuration.php file. If you've made changes to your PHP version or configuration, check whether the PDO_MySQL PHP extension is installed and your system meets all of our system requirements.

You can find more details about the error by enabling error reporting and reloading the page. For help, contact your hosting provider or system administrator.

Critical Error - Could not connect to the $db_name database. PDO extension not found

The application requires the PDO_MySQL PHP extension in order to connect to your MySQL® database but it is not available in your server's PHP configuration.

Check to ensure that your system meets all of our system requirements.

Error Message "Field xxx doesn't have a default value" during installation

This error indicates that you attempted to install WHMCS with MySQL Strict Mode enabled. WHMCS requires you to disable this before installation.

For steps to disable this, see Disabling MySQL Strict Mode.

MySQL server has gone away

This error indicates that the MySQL server is closing the connection WHMCS is using for the current task. You may see this when upgrading WHMCS due to the large number of MySQL queries that upgrading performs. In most cases, this occurs because the timeout value is too low to allow all the upgrade tasks to finish.

To resolve this during generation operations, work with your system administrator or hosting provider to increase the wait_timeout and max_allowed_packet values in the MySQL configuration. If you were performing an upgrade, make certain to restore your pre-upgrade database backups before running the upgrade script again.