Problem
You see one of the following errors:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'table_whmcs7.tbldomainpricing_premium' doesn't exist
or
Unable to complete incremental updates: Unable to import the 8.0.0 Alpha1 database file.
Unable to import /path/to/whmcs/resources/sql/upgrade800alpha1.sql: SQLSTATE[42S02]:
Base table or view not found: 1146 Table 'table_whmcs7.tbldomainpricing_premium' doesn't exist
Cause
This error occurs when a required table is missing from the WHMCS MySQL® database.
In the first example above, the tbldomainpricing_premium
table does not exist.
This issue could occur because of an update failure or accidental or malicious removal of the table.
Solution
To resolve this issue, recreate the table:
- Go to the
/resources/sql/install/
directory. - Identify the
.schema.sql
file with the filename corresponding to the missing table name - Edit the file to view its contents.
- Copy the SQL
CREATE TABLE
command in the file. For example: - Using a database administration tool (for example, phpMyAdmin), execute the copied SQL command. Make certain that it runs successfully.
- Repeat the process for any other missing tables.
If multiple tables are missing, this may indicate a wider issue on the MySQL server, necessitating investigation by a server administrator instead.
Last modified: October 29, 2024