The Problem
XAMPP's MariaDB 10.4.32 refused to start. The Control Panel reported "MySQL shutdown unexpectedly" and the error log was flooded with hundreds of InnoDB errors:
Cannot open datafile for read-only
OS error: 71
OS error: 203
Could not find a valid tablespace file for `clientdb_alpha/some_table`
Could not find a valid tablespace file for `clientdb_beta/some_table`
Could not find a valid tablespace file for `clientdb_gamma/some_table`
The errors repeated for every single table across three databases. XAMPP's control panel timed out waiting for the health check before MariaDB could even finish logging all the failures.
Root Cause
Those three databases — clientdb_alpha, clientdb_beta, and clientdb_gamma — had been removed by deleting their folders directly from C:\xampp\mysql\data\ in Windows Explorer.
InnoDB keeps its own internal data dictionary — a catalogue of every tablespace it manages. Deleting the folder removes the .ibd files but leaves all the references intact. On every startup, MariaDB tries to open hundreds of files that no longer exist.
There was also a second problem: the mysql.db system table (Aria engine) was corrupted, causing a separate fatal error even after the InnoDB issue was addressed:
Fatal error: Can't open and lock privilege tables
What Did NOT Work
- Starting from the XAMPP Control PanelTimed out before MariaDB finished logging errors. The panel's health check gives up too quickly when the error log is flooded.
mysqld.exe --consolewithout the.\prefix in PowerShellPowerShell doesn't search the current directory for executables by default. Runningmysqld.exealone throws "not recognized as a command." It must be.\mysqld.exe.
The Fix
The full recovery required nine steps across two PowerShell windows, working through both the InnoDB orphan problem and the corrupted Aria system table.
Create the missing database directories
InnoDB errors were showing "path not found." Creating empty folders shifts the error to "file not found" — which is less severe and allows the next step to work.
cd C:\xampp\mysql\data\
mkdir clientdb_alpha
mkdir clientdb_beta
mkdir clientdb_gamma
Enable InnoDB force recovery
Open C:\xampp\mysql\bin\my.ini and add one line under the [mysqld] section:
[mysqld]
innodb_force_recovery = 1
Tells InnoDB to skip missing tablespace files instead of aborting on each one. Level 1 is the safest — it allows reads and most writes while skipping corrupted or missing data. Remove it after cleanup.
Start MariaDB manually via PowerShell
Open a PowerShell window as Administrator, navigate to the MariaDB bin directory, and start the server with --console so errors print live:
cd C:\xampp\mysql\bin
.\mysqld.exe --console
Watch the output. It will still log some warnings, but should reach a line saying "ready for connections" instead of shutting down. Leave this window open — do not close it.
Repair the corrupted Aria system table
Open a second PowerShell window as Administrator. The mysql.db system table uses the Aria engine (.MAI/.MAD files), not MyISAM — so aria_chk is the right tool, not myisamchk.
cd C:\xampp\mysql\bin
.\aria_chk.exe --recover "C:\xampp\mysql\data\mysql\db.MAI"
A common mistake is reaching for myisamchk — it won't work on .MAI files. Aria is MariaDB's evolved replacement for MyISAM and has its own repair tool.
Connect to the running server
In the same second PowerShell window:
.\mysql.exe -u root
You should get a MariaDB [(none)]> prompt.
Drop the orphaned databases
This removes the references from InnoDB's data dictionary, which is the actual source of the startup errors:
DROP DATABASE IF EXISTS clientdb_alpha;
DROP DATABASE IF EXISTS clientdb_beta;
DROP DATABASE IF EXISTS clientdb_gamma;
Repair the privilege table and flush
REPAIR TABLE mysql.db;
FLUSH PRIVILEGES;
Both should return OK. Exit the MySQL client: EXIT;
Stop mysqld and remove force recovery
Switch to the first PowerShell window (where mysqld.exe --console is running) and press Ctrl+C to stop it.
Then open C:\xampp\mysql\bin\my.ini and remove the line added in Step 2:
[mysqld]
innodb_force_recovery = 1
[mysqld]
# no force_recovery line
Leaving it in restricts write operations and can prevent normal database activity. It is a recovery tool, not a permanent setting.
Start MySQL normally from XAMPP
Open the XAMPP Control Panel and click Start next to MySQL. It should go green with no errors.
No more InnoDB errors, no privilege table crash, no timeout. All other databases intact.
Key Lessons
| Lesson | Detail |
|---|---|
| Never delete DB folders manually | Always use DROP DATABASE. Deleting folders leaves InnoDB's data dictionary with broken references that crash every subsequent startup. |
| Bypass XAMPP's timeout | The Control Panel gives up too quickly when there are hundreds of errors. Use .\mysqld.exe --console directly to keep it running long enough to recover. |
PowerShell needs .\ |
Unlike CMD, PowerShell does not search the current directory for executables. Prefix every local binary with .\ — e.g. .\mysqld.exe, .\mysql.exe. |
| XAMPP 10.4 uses Aria, not MyISAM | System tables (.MAI/.MAD) are Aria-format. Use aria_chk, not myisamchk. Using the wrong tool silently does nothing. |
innodb_force_recovery = 1 |
Lets MariaDB skip missing tablespace files and start anyway. Safe at level 1. Remove it from my.ini immediately after cleanup. |
TL;DR
Database folders were manually deleted, leaving InnoDB with hundreds of broken tablespace references that crashed startup. Fix: create empty directories, set innodb_force_recovery = 1 in my.ini, start MariaDB manually with .\mysqld.exe --console, repair the Aria system table with aria_chk, drop the three orphaned databases, then remove the recovery flag and restart normally.