Created
December 28, 2023 14:39
-
-
Save spring8904/69b0677e9eb61bac71c1ac1785364a46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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