PHPackages                             dg/mysql-dump - 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. dg/mysql-dump

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

dg/mysql-dump
=============

MySQL database dump.

v1.7.0(1mo ago)2173.1M↑20.4%48[1 issues](https://github.com/dg/MySQL-dump/issues)[3 PRs](https://github.com/dg/MySQL-dump/pulls)9BSD-3-ClausePHPPHP &gt;=7.1

Since Aug 31Pushed 1mo ago13 watchersCompare

[ Source](https://github.com/dg/MySQL-dump)[ Packagist](https://packagist.org/packages/dg/mysql-dump)[ Docs](https://github.com/dg/MySQL-dump)[ RSS](/packages/dg-mysql-dump/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (11)Used By (9)

MySQL Dump Utility
==================

[](#mysql-dump-utility)

This is a backup utility used to dump a database for backup or transfer to another MySQL server. The dump typically contains SQL statements to create the table, populate it, or both.

It requires PHP 8.2 or later.

Usage
-----

[](#usage)

Create [MySQLi](http://www.php.net/manual/en/mysqli.construct.php) object and pass it to the MySQLDump:

```
$db = new mysqli('localhost', 'root', 'password', 'database');
$dump = new MySQLDump($db);
```

You can optionally specify how each table or view should be exported:

```
$dump->tables['search_cache'] = MySQLDump::DROP | MySQLDump::CREATE;
$dump->tables['log'] = MySQLDump::NONE;
```

Available flags: `NONE`, `DROP`, `CREATE`, `DATA`, `TRIGGERS`, `ROUTINES`, and `ALL` (all of the above). `ROUTINES` is read from `$dump->tables['*']` and controls export of stored functions, stored procedures, and scheduled events at the database level. The `DEFINER=` clause is stripped from exported routines so the dump imports cleanly under any user.

Then simply call `save()` or `write()`:

```
$dump->save('export.sql.gz');
```

Import dump from file to database this way:

```
$import = new MySQLImport($db);
$import->load('dump.sql.gz');
```

If you like it, **[please make a donation now](https://nette.org/make-donation?to=mysql-dump)**. Thank you!

###  Health Score

65

—

FairBetter than 99% of packages

Maintenance92

Actively maintained with recent releases

Popularity61

Solid adoption and visibility

Community29

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 79.5% 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 ~556 days

Recently: every ~820 days

Total

10

Last Release

46d ago

PHP version history (2 changes)v1.5.0PHP &gt;=5.6

v1.6.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/17f266513a3ca97500ec3d85d562b9279c7a6346358fe2b8d90390ece717a027?d=identicon)[david@grudl.com](/maintainers/david@grudl.com)

---

Top Contributors

[![dg](https://avatars.githubusercontent.com/u/194960?v=4)](https://github.com/dg "dg (35 commits)")[![JanTvrdik](https://avatars.githubusercontent.com/u/175109?v=4)](https://github.com/JanTvrdik "JanTvrdik (7 commits)")[![jakubvokoun](https://avatars.githubusercontent.com/u/14090004?v=4)](https://github.com/jakubvokoun "jakubvokoun (1 commits)")[![VaclavSir](https://avatars.githubusercontent.com/u/1473642?v=4)](https://github.com/VaclavSir "VaclavSir (1 commits)")

---

Tags

backupmysql-dump-utilityphpmysql

### Embed Badge

![Health badge](/badges/dg-mysql-dump/health.svg)

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

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k605.0M6.8k](/packages/doctrine-dbal)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k32.6M46](/packages/kirschbaum-development-eloquent-power-joins)[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58825.9M54](/packages/scienta-doctrine-json-functions)[cytopia/mysqldump-secure

Secure mysqldump script with encryption, compression, logging, blacklisting and Nagios monitoring integration

1474.7k1](/packages/cytopia-mysqldump-secure)[ark/database

Light weight database abstraction

117.8k](/packages/ark-database)

PHPackages © 2026

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