> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.bearsampp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Database Modules: MySQL, MariaDB, and PostgreSQL

> Manage MySQL, MariaDB, PostgreSQL, and Memcached in Bearsampp. Change ports, reset root passwords, and access web-based admin tools — all from the tray menu.

Bearsampp bundles four database engines that cover the most common needs in local web development: MySQL and MariaDB for relational SQL workloads, PostgreSQL for object-relational projects, and Memcached for in-memory caching. Each database runs as a separate Windows service and can be started, stopped, and configured independently from the system tray.

<Warning>
  MySQL and MariaDB cannot both listen on the same port at the same time. By default, MySQL uses port 3306 and MariaDB uses port 3307. If you change either port, make sure no two database services share the same port number.
</Warning>

***

## MySQL

MySQL is an open-source relational database management system and one of the most widely used databases in web development. Bearsampp runs it as a Windows service and provides phpMyAdmin for browser-based management.

### Default settings

| Property     | Value                         |
| ------------ | ----------------------------- |
| Default port | 3306                          |
| Service name | `bearsamppmysql`              |
| Config file  | `bin/mysql/mysqlX.X.X/my.ini` |
| Web admin    | `http://localhost/phpmyadmin` |

### Tray menu options

Right-click the tray icon → **MySQL** to access:

<CardGroup cols={2}>
  <Card title="Start / Stop service" icon="power-off">
    Start or stop the MySQL Windows service.
  </Card>

  <Card title="Change port" icon="network-wired">
    Switch MySQL to a different port. Bearsampp updates `my.ini` and restarts the service.
  </Card>

  <Card title="Change root password" icon="key">
    Update the MySQL `root` user password through a guided dialog.
  </Card>

  <Card title="Logs / Error logs" icon="file-lines">
    Open the MySQL log file to diagnose connection and startup issues.
  </Card>
</CardGroup>

### phpMyAdmin

phpMyAdmin is available at `http://localhost/phpmyadmin` whenever Apache and MySQL are both running. Log in with username `root` and the root password you configured (empty by default).

***

## MariaDB

MariaDB is a community-developed fork of MySQL that is fully compatible with MySQL's SQL dialect and client tools. It runs alongside MySQL in Bearsampp — you can enable both at the same time on different ports.

### Default settings

| Property     | Value                             |
| ------------ | --------------------------------- |
| Default port | 3307                              |
| Service name | `bearsamppmariadb`                |
| Config file  | `bin/mariadb/mariadbX.X.X/my.ini` |
| Web admin    | `http://localhost/phpmyadmin`     |

### Tray menu options

Right-click the tray icon → **MariaDB** to access:

<CardGroup cols={2}>
  <Card title="Start / Stop service" icon="power-off">
    Start or stop the MariaDB Windows service.
  </Card>

  <Card title="Change port" icon="network-wired">
    Switch MariaDB to a different port.
  </Card>

  <Card title="Change root password" icon="key">
    Update the MariaDB `root` user password.
  </Card>

  <Card title="Logs / Error logs" icon="file-lines">
    Open the MariaDB log file.
  </Card>
</CardGroup>

### phpMyAdmin

phpMyAdmin can manage both MySQL and MariaDB. To connect to MariaDB specifically, update the phpMyAdmin connection settings to point to port 3307 (or whichever port MariaDB is configured to use).

***

## PostgreSQL

PostgreSQL is an advanced object-relational database with strong support for complex queries, JSON, full-text search, and ACID compliance. Bearsampp runs it as a Windows service and includes phpPgAdmin for browser-based management.

### Default settings

| Property     | Value                             |
| ------------ | --------------------------------- |
| Default port | 5432                              |
| Service name | `bearsampppostgresql`             |
| Config dir   | `bin/postgresql/postgresqlX.X.X/` |
| Web admin    | `http://localhost/phppgadmin`     |

### Tray menu options

Right-click the tray icon → **PostgreSQL** to access start/stop controls, port management, and log access — the same pattern as MySQL and MariaDB.

### phpPgAdmin

phpPgAdmin is available at `http://localhost/phppgadmin` whenever Apache and PostgreSQL are both running. Use it to create databases, run queries, and manage users.

***

## Memcached

Memcached is a distributed in-memory object caching system. It is commonly used to reduce database load by caching query results, session data, and computed values in RAM.

### Default settings

| Property     | Value                |
| ------------ | -------------------- |
| Default port | 11211                |
| Service name | `bearsamppmemcached` |

Memcached does not have a configuration file or a web-based admin UI. Start and stop it from the tray menu (**Memcached** → **Start / Stop service**).

<Tip>
  To use Memcached with PHP, enable the `memcached` or `memcache` PHP extension from the tray menu (tray → **PHP** → **Extensions**).
</Tip>
