Annoying WordPress Database Connection Error

When accessing localhost/sitename/wp-login.php an annoying Database connection error started showing up.

My first step was to check the log file and output the contents into a local text file:
journalctl -u mariadb > error.txt

The following lines caught my eye:
mariadbd[1202]: 2025-11-19 5:04:19 32 [Note] InnoDB: The file './sitename/wp_tm_tasks.ibd' already exists though the corresponding table did not exist in the InnoDB data dictionary. You can resolve the problem by removing the file.
mariadbd[1202]: 2025-11-19 5:04:19 32 [Note] InnoDB: The file './sitename/wp_tm_taskmeta.ibd' already exists though the corresponding table did not exist in the InnoDB data dictionary. You can resolve the problem by removing the file.
mariadbd[1202]: 2025-11-19 5:04:19 32 [ERROR] InnoDB: Cannot create file './sitename/wp_tm_tasks.ibd'
mariadbd[1241]: 2025-11-25 12:51:21 0 [ERROR] InnoDB: MySQL-8.0 tablespace in ./sitename/wp_tm_tasks.ibd
mariadbd[1241]: 2025-11-25 12:51:21 0 [ERROR] InnoDB: MySQL-8.0 tablespace in ./sitename/wp_tm_taskmeta.ibd

As evident, two files were repeatedly showing up in the log:
wp_tm_tasks.ibd
wp_tm_taskmeta.ibd

So I went ahead and removed these two files:
sudo rm wp_tm_tasks.ibd
sudo rm wp_tm_taskmeta.ibd

and started up the MySQL server:
sudo service mysql start

All of a sudden, the site’s login page showed up properly and there were no more database connection issues.

Leave a Reply

Your email address will not be published. Required fields are marked *