PHPackages                             matthewbaggett/wait-for-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. matthewbaggett/wait-for-mysql

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

matthewbaggett/wait-for-mysql
=============================

v1.5(2y ago)024.4k↑21.6%GPL-3.0-or-laterShell

Since Jul 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/matthewbaggett/wait-for-mysql)[ Packagist](https://packagist.org/packages/matthewbaggett/wait-for-mysql)[ RSS](/packages/matthewbaggett-wait-for-mysql/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)DependenciesVersions (7)Used By (0)

wait-for-(mysql|postgres|mongodb|redis|dynamodb)
================================================

[](#wait-for-mysqlpostgresmongodbredisdynamodb)

Package that provides a shell script to wait for mysql/mariadb and postgres to be ready.

Does not actually contain any PHP.

[![Test](https://github.com/matthewbaggett/wait-for-mysql/actions/workflows/test.yml/badge.svg)](https://github.com/matthewbaggett/wait-for-mysql/actions/workflows/test.yml)

Usage
-----

[](#usage)

```
export MYSQL_HOST=localhost
export MYSQL_PORT=3306
vendor/bin/wait-for-mysql
```

Or using a DSN:

```
export MYSQL_DSN=mysql://user:password@hostname:port/database
vendor/bin/wait-for-mysql
```

MySQL/MariaDB Flavour
---------------------

[](#mysqlmariadb-flavour)

InputEnvironment VariablesExample InputDefaultMYSQL\_HOST- MYSQL\_HOST
- MYSQL\_HOSTNAME
- MARIADB\_HOST
- MARIADB\_HOSTNAME

`hostname``localhost`MYSQL\_PORT- MYSQL\_PORT
- MARIADB\_PORT

`3306``3306`MYSQL\_DSN- MYSQL\_DSN
- MYSQL\_URL
- DATABASE\_DSN
- DATABASE\_URL

`mysql://user:password@hostname:port/database`Postgres Flavour
----------------

[](#postgres-flavour)

There's also a postgres flavour, `wait-for-postgres` which has similar usage and environment variables as above.

InputEnvironment VariablesExample InputDefaultPOSTGRES\_HOST- POSTGRES\_HOST
- POSTGRES\_HOSTNAME
- PGSQL\_HOST
- PGSQL\_HOSTNAME

`hostname``localhost`POSTGRES\_PORT- POSTGRES\_PORT
- PGSQL\_PORT

`5432``5432`POSTGRES\_DSN- POSTGRES\_DSN
- POSTGRES\_URL
- PGSQL\_DSN
- PGSQL\_DSN
- DATABASE\_DSN
- DATABASE\_URL

`postgres://user:password@hostname:port/database`MongoDB Flavour
---------------

[](#mongodb-flavour)

There's also a mongodb flavour:

InputEnvironment VariablesExample InputDefaultMONGODB\_HOST- MONGODB\_HOST
- MONGODB\_HOSTNAME

`hostname``localhost`MONGODB\_PORT- MONGODB\_PORT

`27017``27017`MONGODB\_DSN- MONGODB\_DSN
- MONGODB\_URL
- DATABASE\_DSN
- DATABASE\_URL

`mongodb://user:password@hostname:port/database`MONGODB\_DATABASE- MONGODB\_DATABASE

`database`MONGODB\_USERNAME- MONGODB\_USERNAME

`username`MONGODB\_PASSWORD- MONGODB\_PASSWORD

`password`Redis Flavour
-------------

[](#redis-flavour)

There's also a redis flavour:

InputEnvironment VariablesExample InputDefaultREDIS\_HOST- REDIS\_HOST
- REDIS\_HOSTNAME

`hostname``redis`REDIS\_PORT- REDIS\_PORT

`6379``6379`REDIS\_PASSWORD- REDIS\_PASSWORD

`password`DynamoDB Flavour
----------------

[](#dynamodb-flavour)

There's also a dynamodb flavour:

InputEnvironment VariablesExample InputDefaultDYNAMODB\_ENDPOINT- DYNAMODB\_ENDPOINT

`http://dynamo:8000`

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Every ~201 days

Recently: every ~235 days

Total

6

Last Release

760d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5707be384b9daab9858223c5dfead9d692e8b5f6afa8dd23ad5c5cbc149316b2?d=identicon)[matthewbaggett](/maintainers/matthewbaggett)

---

Top Contributors

[![matthewbaggett](https://avatars.githubusercontent.com/u/943948?v=4)](https://github.com/matthewbaggett "matthewbaggett (18 commits)")

### Embed Badge

![Health badge](/badges/matthewbaggett-wait-for-mysql/health.svg)

```
[![Health](https://phpackages.com/badges/matthewbaggett-wait-for-mysql/health.svg)](https://phpackages.com/packages/matthewbaggett-wait-for-mysql)
```

PHPackages © 2026

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