# ⚠️ CRITICAL FIX NEEDED: Enable pdo_mysql Extension

## 🔴 Problem
Your database credentials are correct, but **PHP's pdo_mysql extension is not enabled**.

## ✅ Quick Fix (3 Steps)

### Step 1: Open php.ini as Administrator

```powershell
notepad C:\php\php.ini
```

*(Right-click and "Run as Administrator")*

### Step 2: Find and Uncomment the pdo_mysql Line

**Search for (Ctrl+F):**
```
;extension=pdo_mysql
```

**Change it to (remove the semicolon):**
```
extension=pdo_mysql
```

**If you can't find it,** add this line in the extensions section:
```ini
extension=pdo_mysql
```

### Step 3: Save and Restart

1. **Save** the php.ini file (Ctrl+S)
2. **Restart your web server:**
   - IIS: `iisreset` (in Admin Command Prompt)
   - Apache: Restart Apache service
   - Or restart your computer

### Step 4: Verify

Run this to confirm it's enabled:
```powershell
php -m | Select-String "pdo_mysql"
```

You should see:
```
pdo_mysql
```

## 🎯 After Fixing

Once pdo_mysql is enabled, run the database diagnostic again:
```powershell
php check_database.php
```

Then try logging in with:
- **Username:** admin
- **Password:** admin123

## 📝 Your Current Configuration

✓ .env file exists and is configured correctly:
```env
DB_HOST=localhost
DB_DATABASE=admin254_invento
DB_USERNAME=admin254_invento
DB_PASSWORD=y?o{YYw]Up!M{*jr
```

✓ Extension file exists: `C:\php\ext\php_pdo_mysql.dll`

✓ PDO base extension is loaded

❌ pdo_mysql extension is NOT enabled in php.ini

## 🔧 Alternative: Edit php.ini Manually

1. Open: `C:\php\php.ini`
2. Find the "Dynamic Extensions" section (around line 900-1000)
3. Look for lines starting with `extension=`
4. Add or uncomment: `extension=pdo_mysql`
5. Save and restart web server

## ⚡ Production Server Notes

Since you're on production (`admin254_invento`), after making changes:

1. Clear any opcache if enabled
2. Restart PHP-FPM or web server
3. Check PHP info to verify: `php -i | Select-String "pdo_mysql"`

---

**The fix takes less than 2 minutes. Your credentials are fine, just need to enable the extension!**
