# 🚨 Quick Fix - Create Database Now!

## Error: Unknown database 'cargo_management'

You need to create the database first. Choose ONE method below:

---

## ✅ Method 1: Using phpMyAdmin (EASIEST)

### If you have XAMPP or WAMP:

1. **Start XAMPP/WAMP** Control Panel
2. **Start MySQL** service (click Start button)
3. **Open phpMyAdmin** in browser:
   - XAMPP: http://localhost/phpmyadmin
   - WAMP: http://localhost/phpmyadmin
4. Click **"New"** in the left sidebar
5. Database name: `cargo_management`
6. Collation: `utf8mb4_unicode_ci`
7. Click **"Create"**

✅ Done! Now go back to http://localhost:8080

---

## ✅ Method 2: Using MySQL Workbench

1. Open **MySQL Workbench**
2. Connect to your local MySQL server
3. Click the **"Create Schema"** icon (cylinder with +)
4. Schema name: `cargo_management`
5. Charset: `utf8mb4`
6. Click **"Apply"**

✅ Done! Now go back to http://localhost:8080

---

## ✅ Method 3: Using Command Line

### Find MySQL in your system:

**For XAMPP:**
```cmd
cd C:\xampp\mysql\bin
mysql -u root -p
```

**For WAMP:**
```cmd
cd C:\wamp64\bin\mysql\mysql8.0.x\bin
mysql -u root -p
```

**Then run:**
```sql
CREATE DATABASE cargo_management CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
SHOW DATABASES;
exit;
```

✅ Done! Now go back to http://localhost:8080

---

## ✅ Method 4: Using HeidiSQL (if installed)

1. Open **HeidiSQL**
2. Connect to your MySQL server
3. Right-click on server name
4. Select **"Create new"** → **"Database"**
5. Name: `cargo_management`
6. Collation: `utf8mb4_unicode_ci`
7. Click **OK**

✅ Done! Now go back to http://localhost:8080

---

## After Creating Database:

The system will automatically create all tables when you refresh the page!

If you see any migration errors, run this command:
```cmd
php artisan migrate
```

---

## Still Having Issues?

### Check if MySQL is running:
- XAMPP: Open control panel, MySQL should show "Running"
- WAMP: Icon should be green
- Services: Check if MySQL80 service is running

### Check your password:
Open `.env` file and verify:
```env
DB_PASSWORD=
```
If you have a password, add it there!

---

## Quick Checklist:

- [ ] MySQL is running (XAMPP/WAMP started)
- [ ] Database `cargo_management` created
- [ ] .env file has correct password
- [ ] Refresh http://localhost:8080

---

**Need Help?** The easiest way is Method 1 (phpMyAdmin)!
