PHPackages                             bannerstop/tunneled-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. bannerstop/tunneled-mysql

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

bannerstop/tunneled-mysql
=========================

Using a MySQL server via an SSH tunnel.

0.0.1(1y ago)089MITPHPPHP &gt;=7.4

Since Nov 2Pushed 1y ago2 watchersCompare

[ Source](https://github.com/bannerstop/tunneled-mysql)[ Packagist](https://packagist.org/packages/bannerstop/tunneled-mysql)[ RSS](/packages/bannerstop-tunneled-mysql/feed)WikiDiscussions master Synced 1mo ago

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

MySQL via SSH Tunnel
====================

[](#mysql-via-ssh-tunnel)

Using a MySQL server via an SSH tunnel.

Notice
------

[](#notice)

SSH Tunnel does not currently support requesting the SSH password for the private key provided, so make sure your SSH key does not require a password.

If you are not sure whether your SSH key pair requires a passphrase, you can create a new SSH key pair

```
# generate key pair without passphrase
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa_no_pass -N ""

# copy public key to remote server
ssh-copy-id -i ~/.ssh/id_rsa_no_pass.pub user@host
```

Make sure that your PHP application has the authorization to access the private SSH key file

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

[](#installation)

Use Composer to install:

```
composer require bannerstop/tunneled-mysql
```

Usage
-----

[](#usage)

```
$tunnelBuilder = new \Bannerstop\TunneledMysql\TunnelBuilder(
    new \Bannerstop\TunneledMysql\SSH\SSHCredentials(
        'ssh.example.host',
        'user',
        'path/to/private_key'
    ),
    new \Bannerstop\TunneledMysql\MySQL\MySQLCredentials(
        'username',
        'pass',
        'dbname'
    ),
    (new \Bannerstop\TunneledMysql\Lib\GetAvailablePort())->execute()
);
$mysql = $tunnelBuilder->build()->run();

$query = $mysql->query('SELECT * FROM example LIMIT 1');
print_r($query->fetch());
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance40

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 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

553d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/28f157ab08162319e7ad1983e00b7f3ae62df5ebd668f90e446593eea53fd0e4?d=identicon)[bannerstop](/maintainers/bannerstop)

![](https://www.gravatar.com/avatar/038e95175fdc7e8a07120c32db14e2ac75ab46a476fef9014cc19240c4d42a02?d=identicon)[mluex](/maintainers/mluex)

---

Top Contributors

[![mluex](https://avatars.githubusercontent.com/u/20678805?v=4)](https://github.com/mluex "mluex (2 commits)")

### Embed Badge

![Health badge](/badges/bannerstop-tunneled-mysql/health.svg)

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M543](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M209](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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