Skip to content

Commit 48d8444

Browse files
committed
first commit
0 parents  commit 48d8444

File tree

4 files changed

+571
-0
lines changed

4 files changed

+571
-0
lines changed

README.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<h1 align="center">
2+
MySQL Password Reset Tool
3+
<br>
4+
</h1>
5+
6+
<h4 align="center">Reset your forgotten MySQL root password safely in seconds</h4>
7+
8+
<p align="center">
9+
<a href="https://github.com/devddine/mysql-password-reset/issues">
10+
<img alt="GitHub Issues" src="https://img.shields.io/github/issues/devddine/mysql-password-reset?style=plastic">
11+
</a>
12+
<a href="https://github.com/devddine/mysql-password-reset/pulls">
13+
<img alt="GitHub Pull Requests" src="https://img.shields.io/github/issues-pr/devddine/mysql-password-reset?style=plastic">
14+
</a>
15+
<a href="https://github.com/devddine/mysql-password-reset/graphs/contributors">
16+
<img alt="GitHub contributors" src="https://img.shields.io/github/contributors/devddine/mysql-password-reset?style=plastic">
17+
</a>
18+
<a href="https://github.com/sponsors/devddine">
19+
<img alt="GitHub Sponsors" src="https://img.shields.io/github/sponsors/devddine?style=plastic">
20+
</a>
21+
</p>
22+
23+
<p align="center">
24+
<a href="#-quick-start">Quick Start</a> •
25+
<a href="#-prerequisites">Prerequisites</a> •
26+
<a href="#-troubleshooting">Troubleshooting</a> •
27+
<a href="#-safety">Safety</a> •
28+
<a href="#-contributing">Contributing</a> •
29+
<a href="#-license">License</a>
30+
</p>
31+
32+
---
33+
34+
## 🚀 Quick Start
35+
36+
**Windows:**
37+
```bash
38+
Right-click 'run.bat' → Run as administrator
39+
```
40+
41+
**Mac/Linux:**
42+
```bash
43+
chmod +x run.sh
44+
sudo ./run.sh
45+
```
46+
47+
## ✅ Prerequisites
48+
49+
- Python installed
50+
- MySQL installed
51+
- Admin/sudo access
52+
- Data backup (optional but recommended)
53+
54+
## 📁 Project Structure
55+
56+
```
57+
├── run.bat (Windows launcher)
58+
├── run.sh (Mac/Linux launcher)
59+
├── src/main.py (Reset tool)
60+
├── README.md (You are here)
61+
└── LICENSE (MIT License)
62+
```
63+
64+
## ❓ Troubleshooting
65+
66+
| Issue | Solution |
67+
|-------|----------|
68+
| Python not found | Download from https://www.python.org/downloads/ |
69+
| Permission denied | Use `sudo ./run.sh` |
70+
| MySQL not found | Ensure MySQL is installed |
71+
72+
## 🔒 Safety
73+
74+
- Your password is **never saved** to disk
75+
- Your password is **never logged** or sent anywhere
76+
- All temporary files are **automatically deleted**
77+
- You need admin rights to make this work (that's normal!)
78+
79+
## 🐛 Issues?
80+
81+
Found a bug? Report it: https://github.com/devddine/mysql-password-reset/issues
82+
83+
## ❤️ Support This Project
84+
85+
- ⭐ Star the repo
86+
- 💬 Share feedback
87+
- 🤝 Sponsor: https://github.com/sponsors/devddine
88+
89+
## 📄 License
90+
91+
MIT License - see [LICENSE](LICENSE) file for details
92+
93+
---
94+
95+
<div align="center"><sub>Built with ❤️ by <a href="https://github.com/devddine">devddine</a></sub></div>

run.bat

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
@echo off
2+
REM MySQL Password Reset Tool - Windows Batch Script
3+
REM This script runs the MySQL password reset tool with administrator privileges
4+
5+
setlocal enabledelayedexpansion
6+
7+
REM Get the script directory
8+
set SCRIPT_DIR=%~dp0
9+
10+
REM Check if Python is installed
11+
python --version >nul 2>&1
12+
if errorlevel 1 (
13+
echo ERROR: Python is not installed or not in PATH
14+
echo Please install Python 3.6 or higher from https://www.python.org
15+
echo Make sure to check "Add Python to PATH" during installation
16+
pause
17+
exit /b 1
18+
)
19+
20+
REM Check if running as administrator
21+
net session >nul 2>&1
22+
if errorlevel 1 (
23+
echo ERROR: This script requires Administrator privileges
24+
echo Please run this script as Administrator
25+
pause
26+
exit /b 1
27+
)
28+
29+
REM Run the MySQL reset script
30+
echo Running MySQL Password Reset Tool...
31+
echo.
32+
python "%SCRIPT_DIR%src\main.py"
33+
34+
REM Capture exit code
35+
set EXIT_CODE=%errorlevel%
36+
37+
if %EXIT_CODE% equ 0 (
38+
echo.
39+
echo SUCCESS: Password reset completed
40+
) else (
41+
echo.
42+
echo FAILED: Password reset did not complete successfully
43+
)
44+
45+
pause
46+
exit /b %EXIT_CODE%

run.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
# MySQL Password Reset Tool - Linux/Mac Shell Script
3+
# This script runs the MySQL password reset tool with sudo privileges
4+
5+
# Get the script directory
6+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7+
8+
# Check if Python is installed
9+
if ! command -v python3 &> /dev/null; then
10+
echo "ERROR: Python 3 is not installed"
11+
echo "Please install Python 3.6 or higher:"
12+
echo " Ubuntu/Debian: sudo apt-get install python3"
13+
echo " CentOS/RHEL: sudo yum install python3"
14+
echo " macOS: brew install python3"
15+
exit 1
16+
fi
17+
18+
# Check if running as root
19+
if [[ $EUID -ne 0 ]]; then
20+
echo "ERROR: This script requires root privileges"
21+
echo "Please run with sudo: sudo $0"
22+
exit 1
23+
fi
24+
25+
# Run the MySQL reset script
26+
echo "Running MySQL Password Reset Tool..."
27+
echo ""
28+
python3 "$SCRIPT_DIR/src/main.py"
29+
30+
# Capture exit code
31+
EXIT_CODE=$?
32+
33+
if [ $EXIT_CODE -eq 0 ]; then
34+
echo ""
35+
echo "SUCCESS: Password reset completed"
36+
else
37+
echo ""
38+
echo "FAILED: Password reset did not complete successfully"
39+
fi
40+
41+
exit $EXIT_CODE

0 commit comments

Comments
 (0)