# Reset MySQL Root Password on Windows

## Method 1: Using MySQL Workbench (Easiest)
1. Open MySQL Workbench
2. If you can connect without password, do so
3. Go to Server > Users and Privileges
4. Select root user and set a new password

## Method 2: Using Command Line

### Step 1: Stop MySQL Service
```cmd
net stop MySQL80
```
(Replace MySQL80 with your MySQL service name - check in Services)

### Step 2: Start MySQL in Safe Mode
```cmd
mysqld --console --skip-grant-tables --skip-networking
```

### Step 3: Open Another Command Prompt and Connect
```cmd
mysql -u root
```

### Step 4: Reset Password
```sql
FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'your_new_password';
FLUSH PRIVILEGES;
EXIT;
```

### Step 5: Stop Safe Mode MySQL
Press Ctrl+C in the first command prompt

### Step 6: Start MySQL Normally
```cmd
net start MySQL80
```

## Method 3: Create New Admin User (Easier)

If you can connect to MySQL at all (even with another user), run:

```sql
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin123';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
```

Then update your .env file to use this new user.

## Quick Test
After resetting, test with:
```cmd
mysql -u root -p
```
Enter your new password when prompted.
