PHPackages                             marko/database-mysql - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. marko/database-mysql

ActiveLibrary[Database &amp; ORM](/categories/database)

marko/database-mysql
====================

MySQL driver for Marko Framework Database Layer

0.7.0(4w ago)072MITPHPPHP ^8.5

Since Mar 25Pushed 4w agoCompare

[ Source](https://github.com/marko-php/marko-database-mysql)[ Packagist](https://packagist.org/packages/marko/database-mysql)[ RSS](/packages/marko-database-mysql/feed)WikiDiscussions develop Synced 3w ago

READMEChangelogDependencies (12)Versions (18)Used By (0)

marko/database-mysql
====================

[](#markodatabase-mysql)

MySQL and MariaDB driver for the Marko framework database layer.

Installation
------------

[](#installation)

```
composer require marko/database-mysql
```

This automatically installs `marko/database` (the interface package) as a dependency.

Configuration
-------------

[](#configuration)

Publish or create `config/database.php` and set your connection details:

```
return [
    'default' => env('DB_CONNECTION', 'mysql'),

    'connections' => [
        'mysql' => [
            'driver'   => 'mysql',
            'host'     => env('DB_HOST', '127.0.0.1'),
            'database' => env('DB_DATABASE', 'marko'),
            'username' => env('DB_USERNAME', 'root'),
            'password' => env('DB_PASSWORD', ''),
        ],
    ],
];
```

Set the corresponding values in your `.env` file:

```
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_DATABASE=marko
DB_USERNAME=root
DB_PASSWORD=secret
```

Driver Notes
------------

[](#driver-notes)

This driver supports **MySQL** 8.0+ and **MariaDB** 10.6+. Both are fully supported via the same driver key (`mysql`).

Quick Example
-------------

[](#quick-example)

```
use Marko\Database\Connection\ConnectionInterface;

class MyService
{
    public function __construct(
        private ConnectionInterface $connection,
    ) {}

    public function doSomething(): void
    {
        $result = $this->connection->query('SELECT * FROM users');
    }
}
```

Documentation
-------------

[](#documentation)

Full configuration, driver notes, and API reference: [marko/database-mysql](https://marko.build/docs/packages/database-mysql/)

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance94

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

16

Last Release

28d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/437029?v=4)[Mark Shust](/maintainers/markshust)[@markshust](https://github.com/markshust)

---

Top Contributors

[![markshust](https://avatars.githubusercontent.com/u/437029?v=4)](https://github.com/markshust "markshust (34 commits)")[![samsteele](https://avatars.githubusercontent.com/u/10742174?v=4)](https://github.com/samsteele "samsteele (6 commits)")[![michalbiarda](https://avatars.githubusercontent.com/u/1135380?v=4)](https://github.com/michalbiarda "michalbiarda (1 commits)")[![teunissenstefan](https://avatars.githubusercontent.com/u/1182849?v=4)](https://github.com/teunissenstefan "teunissenstefan (1 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/marko-database-mysql/health.svg)

```
[![Health](https://phpackages.com/badges/marko-database-mysql/health.svg)](https://phpackages.com/packages/marko-database-mysql)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
