Here we will cover what to do when the WordPress Wordfence plugin fails to create the wfls_settings and wfls_2fa_secrets tables. This can occasionally happen during plugin installation.
The exact error message when these tables are missing is as follows:
wp_wfls_settings.ibd the wp_wfls_2fa_secrets.ibd already exists, but the corresponding tables did not exist in the InnoDB data dictionary.
We can regenerate these tables by running a SQL query in phpMyAdmin.
Related Articles
Setting Up Wordfence to Filter Comment Spam
Install a WordPress Plugin
Recreating the Tables
- Log into cPanel
- Locating the database name and database prefix for the site
- Click on File Manager in the Files section
- Navigate to the Document Root of the relevant WordPress website
- Locate the wp-config.php file
- Right-click on the file and select View
- Locate and make note of the database name (DB_NAME)
- Locate and make note of the table prefix (table_prefix)
- Click on File Manager in the Files section
- Regenerating the missing tables in phpMyAdmin
- From the main cPanel page, click on phpMyAdmin in the Databases section
- Click on the WordPress site's database on the left side panel
TIP: The database name was found in step 2E. - In the top toolbar, choose SQL
- In the text box, enter the following to recreate the tables:
REPLACE: dbprefix_ with the correct WordPress table prefix found in step 2F.
CREATE TABLE IF NOT EXISTS `dbprefix_wfls_2fa_secrets` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned NOT NULL,
`secret` tinyblob NOT NULL,
`recovery` blob NOT NULL,
`ctime` int(10) unsigned NOT NULL,
`vtime` int(10) unsigned NOT NULL,
`mode` enum('authenticator') NOT NULL DEFAULT 'authenticator',
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `dbprefix_wfls_settings` (
`name` varchar(191) NOT NULL DEFAULT '',
`value` longblob,
`autoload` enum('no','yes') NOT NULL DEFAULT 'yes',
PRIMARY KEY (`name`)
) DEFAULT CHARSET=utf8; - Click Go to create the tables.
- From the main cPanel page, click on phpMyAdmin in the Databases section