PHPackages                             mkubenka/yii2-db-reconnect - 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. mkubenka/yii2-db-reconnect

ActiveYii2-extension[Database &amp; ORM](/categories/database)

mkubenka/yii2-db-reconnect
==========================

Yii2 DB Auto Reconnect

1.1.1(6y ago)722.5k↓44.6%1MITPHPCI failing

Since Apr 2Pushed 6y ago1 watchersCompare

[ Source](https://github.com/mkubenka/yii2-db-reconnect)[ Packagist](https://packagist.org/packages/mkubenka/yii2-db-reconnect)[ Docs](https://github.com/mkubenka/yii2-db-reconnect)[ RSS](/packages/mkubenka-yii2-db-reconnect/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

Yii2 DB Auto Reconnect [![Build Status](https://camo.githubusercontent.com/f521733e045b4390c7ada378c0dd5b5f20e38639678b41180104f21dc8b4529e/68747470733a2f2f7472617669732d63692e6f72672f6d6b7562656e6b612f796969322d64622d7265636f6e6e6563742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mkubenka/yii2-db-reconnect)
====================================================================================================================================================================================================================================================================================================================================

[](#yii2-db-auto-reconnect-)

[![Latest Stable Version](https://camo.githubusercontent.com/19fafd7c405a994818087d3f43e902eb24da564c108491b682d1f6dcdfd8ee28/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6b7562656e6b612f796969322d64622d7265636f6e6e6563742e737667)](https://packagist.org/packages/mkubenka/yii2-db-reconnect)

> Inspired by:
>
>

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

[](#installation)

```
composer require mkubenka/yii2-db-reconnect
```

or

```
"require": {
    "mkubenka/yii2-db-reconnect": "~1.0"
},
```

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

[](#configuration)

```
'db' => [
    'class' => 'mkubenka\dbreconnect\mysql\Connection',
    'reconnectMaxCount' => 2,
    'dsn' => 'mysql:host=127.0.0.1;dbname=test',
    'username' => 'root',
    'password' => '',
    'charset' => 'utf8',
],
```

### Logging

[](#logging)

```
'log' => [
    'targets' => [
        [
            'class' => 'yii\log\FileTarget',
            'levels' => ['error', 'info'],
            'maxLogFiles' => 20,
            'maxFileSize' => 2048,
            'categories' => [
                'mkubenka\dbreconnect\*',
            ],
            'logFile' => '@frontend/runtime/logs/dbreconnect.log',
        ],
    ],
],
```

Known limitations
-----------------

[](#known-limitations)

This method only works for non transactional statements.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 95% 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 ~298 days

Total

4

Last Release

2438d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/49a0af8dce02f760a2525dd4cffee20492254482f539d1a88a2a8a4c39f1377d?d=identicon)[mkubenka](/maintainers/mkubenka)

---

Top Contributors

[![mkubenka](https://avatars.githubusercontent.com/u/933201?v=4)](https://github.com/mkubenka "mkubenka (19 commits)")[![andrejskuba](https://avatars.githubusercontent.com/u/2269010?v=4)](https://github.com/andrejskuba "andrejskuba (1 commits)")

---

Tags

mysqldbyii2

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mkubenka-yii2-db-reconnect/health.svg)

```
[![Health](https://phpackages.com/badges/mkubenka-yii2-db-reconnect/health.svg)](https://phpackages.com/packages/mkubenka-yii2-db-reconnect)
```

###  Alternatives

[rah/danpu

Zero-dependency MySQL dump library for easily exporting and importing databases

64401.8k10](/packages/rah-danpu)[sjaakp/yii2-spatial

Yii2 ActiveRecord supporting MySQL spatial data

1873.8k1](/packages/sjaakp-yii2-spatial)[dmstr/yii2-db

Database extensions

19618.8k6](/packages/dmstr-yii2-db)[craftcms/query

Execute database queries from the Control Panel

1614.5k1](/packages/craftcms-query)[smrtr/mysql-version-control

A crude version control system for mysql written in php

221.4k](/packages/smrtr-mysql-version-control)

PHPackages © 2026

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