Recover Single Database Directory
When only one MySQL database needs recovery, initialize metadata from the offline copy and select that database for export.
I. Initialize the Database Directory
param datadir /recovery-input/mysql/data;
b;
\l;
use appdb;
\dt;II. Access the Database
2.1 View Available Databases
Use \l; to view identified databases. Do not force same-name files to represent a database that was not identified.
\l;2.2 Enter the Database and View Tables
use appdb;
\dt;
\d orders;III. Export Database Data
unload ddl appdb;
unload db appdb;Export only confirmed usable tables. Retain original status when the database inventory has missing entries; successful initialization does not mean that all data has been recovered.
IV. Understanding the Exported Data
PDU uses its current directory at startup for tasks and output. Exported SQL files are written directly there, and internal task records are stored in .pdu-work. Export table definitions separately with unload ddl. Recovery commands generate SQL without writing to the target database. The records in .pdu-work retain the program's success and failure counts, original errors and checkpoints.
After export, record the native success and failure counts and original errors reported by PDU, and retain the checkpoint. Resume uses native records and file metadata such as existence and size without rereading exported data.
V. Using the Exported Data
Create matching definitions in an isolated target database before importing data SQL. Views, triggers, routines and events have separate metadata paths; table data export does not establish that they were recovered completely.
Exporting Multiple Databases
Run use, unload ddl and unload db separately for each database, preserving individual output and original errors.