Troubleshooting the Database

If you encounter errors or issues while working with the database for your WHMCS installation, see the sections below to start troubleshooting and resolve the issue.

For more information, see Database Requirements.

General Issues

You may encounter the following common issues:

Error or IssueExplanationNext Steps
Could not connect to database
or
Critical Error - Unable to connect to the database
These errors indicate that the system cannot connect to your database.Could Not Connect Errors
Unable to Connect Errors
Down for Maintenance (Err2) An upgrade is currently in progressIf an update is not currently in progress, this indicates a version mismatch between the PHP files and the MySQL® database.Down for Maintenance Errors
Error: SQLSTATE[HY000]: General error: 3988 Conversion from collation utf8mb3_unicode_ci into latin1_swedish_ci impossible for parameter (SQL: insert into tblticketmaillog...MySQL® cannot convert the table in the error message into the indicated character set.POP3 General Error 3988 Errors
Field xxx doesn't have a default valueThis error indicates that you attempted to install WHMCS with MySQL Strict Mode enabled.Field Default Value Errors
MySQL server has gone awayThis error indicates that the MySQL® server is closing the connection that WHMCS is using for the current task.MySQL Server Gone Away Errors
Order Not Found...Exiting...This error is due to an inability for the WHMCS software to write to the MySQL® database.Order Not Found Errors
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' in /path/to/whmcs/vendor/illuminate/database/Connection.phpThis error occurs when the primary key and auto_increment attributes are missing.Duplicate Entry Errors
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'group_id' cannot be null (SQL: insert into tblproducts_slugs (group_id, group_slug, slug, active, product_id, updated_at, created_at) values (?, ?, , 1, 1, 2021-09-30 10:24:30, 2021-09-30 10:24:30))This indicates that there are orphaned products in the database.Column group_id Null Errors
SQLSTATE[42000]: Syntax error or access violation: 1142 INDEX command denied to userThe MySQL® user has insufficient privileges.Command Denied Errors
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'table_whmcs7.tbldomainpricing_premium' doesn't existThis error occurs when a required table is missing from the WHMCS MySQL® database.Base Table or View Not Found Errors
TypeError: Argument 1 passed to Illuminate\Database\Connection::prepared() must be an instance of PDOStatement, bool givenThe Module Log is enabled and the system is logging a large amount of data or the wait_timeout and interactive_timeout variables in the MySQL server configuration are too low.Argument PDOStatement Errors

Database Backups

For more information, see Database Backups.

You may encounter the following common issues:

Error or IssueExplanationNext Steps
SFTP Backup - Login FailedThis error indicates that the system reached the FTP server but it rejected the login details.SQL Backup Login Errors
(S)FTP Backup - Uploading FailedThis error indicates that the connection to the FTP server succeeded but the system could not navigate to the destination directory or did not have write permissions.SQL Backup Uploading Errors
(S)FTP: Unable to open for writingThis error indicates that WHMCS cannot open a test file in the PHP system directory (the sys_temp_dir PHP setting) via the PHP fopen function.SFTP Unable to Open Errors
(S)FTP: Unable to write to temp fileThis error indicates that WHMCS cannot write to a test file in the PHP system directory (the sys_temp_dir PHP setting) via the PHP fwrite function.SFTP Unable to Write Errors

Last modified: June 14, 2024