Skip to content

Instantly share code, notes, and snippets.

@lioneltchami
Created January 3, 2025 06:59
Show Gist options
  • Save lioneltchami/ffc39efda9a790d7b663fd039dc68511 to your computer and use it in GitHub Desktop.
Save lioneltchami/ffc39efda9a790d7b663fd039dc68511 to your computer and use it in GitHub Desktop.

Step 1: Version MySQL Server

Ensure you install the same version of MySQL server that was previously on your system. This is crucial for compatibility.

Step 2: Locate the Data Folder

MySQL data folder is usually located at:

C:\ProgramData\MySQL\MySQL Server x.x\data

Step 3: Stop MySQL Service

Stop the MySQL service through the Windows Services panel or using the command line.

Step 4: Copy Database Files

Copy the folders corresponding to your databases from the old data folder to the new MySQL data directory.

Step 5: Set Proper Permissions

Ensure the copied files have the correct ownership. In Windows, the MySQL service account should have full control over these files.

Step 6: Restart MySQL Service

Start the MySQL service again. Your databases should now be visible and accessible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment