PHPackages                             fbf/mysql-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. fbf/mysql-reconnect

ActiveLibrary

fbf/mysql-reconnect
===================

A PDO wrapper that reconnects automatically and re-issues queries on receiving MySQL server timeout errors

v0.1.0(12y ago)1211MITPHPPHP &gt;=5.3.0

Since Oct 14Pushed 12y ago1 watchersCompare

[ Source](https://github.com/FbF/MySQL-Reconnect)[ Packagist](https://packagist.org/packages/fbf/mysql-reconnect)[ RSS](/packages/fbf-mysql-reconnect/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

MySQL-Reconnect
===============

[](#mysql-reconnect)

A PDO wrapper that reconnects automatically and re-issues queries on receiving MySQL server timeout errors

Usage
-----

[](#usage)

```
$config = array(
	'driver' => 'mysql',
    'host' => 'localhost',
    'database' => 'mydb',
    'user' => 'username',
    'pass' => 'password',
);

$db = new Fbf\MysqlReconnect\Db($config);

$sql = "SELECT * FROM posts WHERE id = :id";

$data = array('id' => 1);

$sth = $db->query($sql, $data);

$post = $sth->fetchObj();

```

How it works
------------

[](#how-it-works)

Uses \_\_call() magic method to pass off methods called to the PDO connection object, so you can call whatever you like on $db and it will pass it off to PDO. Inside the magic method we catch timeout exceptions and then reconnect before re-issuing the query.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

4596d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c1890fa7f83fd77b7c73d984199cb9a45ba9871acb4133490f43115c19fe845f?d=identicon)[neilcrookes](/maintainers/neilcrookes)

---

Top Contributors

[![neilcrookes](https://avatars.githubusercontent.com/u/24232?v=4)](https://github.com/neilcrookes "neilcrookes (1 commits)")

### Embed Badge

![Health badge](/badges/fbf-mysql-reconnect/health.svg)

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

PHPackages © 2026

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