Ensure you install the same version of MySQL server that was previously on your system. This is crucial for compatibility.
MySQL data folder is usually located at:
C:\ProgramData\MySQL\MySQL Server x.x\data
Stop the MySQL service through the Windows Services panel or using the command line.
Copy the folders corresponding to your databases from the old data folder to the new MySQL data directory.
Ensure the copied files have the correct ownership. In Windows, the MySQL service account should have full control over these files.
Start the MySQL service again. Your databases should now be visible and accessible.