Skip to content

Instantly share code, notes, and snippets.

@spring8904
Created December 28, 2023 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spring8904/69b0677e9eb61bac71c1ac1785364a46 to your computer and use it in GitHub Desktop.
Save spring8904/69b0677e9eb61bac71c1ac1785364a46 to your computer and use it in GitHub Desktop.
Rename-Item -Path "./data" -NewName "./data_old"
Copy-Item -Path "./backup" -Destination "./data" -Recurse
Remove-Item "./data/test" -Recurse
$dbPaths = Get-ChildItem -Path "./data_old" -Exclude ('mysql', 'performance_schema', 'phpmyadmin') -Recurse -Directory
Copy-Item -Path $dbPaths.FullName -Destination "./data" -Recurse
Copy-Item -Path "./data_old/ibdata1" -Destination "./data/ibdata1"
Based on this answer: https://stackoverflow.com/a/61859561/1956278
---
PowerShell.exe -ExecutionPolicy UnRestricted -File repair-mysql-data.ps1
---
CREATE USER 'root'@'%' IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment