PHPackages                             druidfi/mysqldump-php - 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. druidfi/mysqldump-php

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

druidfi/mysqldump-php
=====================

PHP version of mysqldump cli that comes with MySQL

2.0.3(2mo ago)35489.8k↑94.6%9[3 issues](https://github.com/druidfi/mysqldump-php/issues)[1 PRs](https://github.com/druidfi/mysqldump-php/pulls)6GPL-3.0-or-laterPHPPHP ^8.1CI passing

Since Aug 19Pushed 2mo ago5 watchersCompare

[ Source](https://github.com/druidfi/mysqldump-php)[ Packagist](https://packagist.org/packages/druidfi/mysqldump-php)[ Docs](https://github.com/druidfi/mysqldump-php)[ RSS](/packages/druidfi-mysqldump-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (21)Used By (6)

mysqldump-php
=============

[](#mysqldump-php)

[![Run tests](https://github.com/druidfi/mysqldump-php/actions/workflows/tests.yml/badge.svg)](https://github.com/druidfi/mysqldump-php/actions/workflows/tests.yml)[![Total Downloads](https://camo.githubusercontent.com/9f0271d513ca68a132c8d3d37e6d670cc37e4cc4863f024e21f397d72457482f/68747470733a2f2f706f7365722e707567782e6f72672f647275696466692f6d7973716c64756d702d7068702f646f776e6c6f616473)](https://packagist.org/packages/druidfi/mysqldump-php)[![Monthly Downloads](https://camo.githubusercontent.com/c9fd4d3d1faa02b1e64ce207c49a52a92442be477d0c44b1e33eddb0382f7c85/68747470733a2f2f706f7365722e707567782e6f72672f647275696466692f6d7973716c64756d702d7068702f642f6d6f6e74686c79)](https://packagist.org/packages/druidfi/mysqldump-php)[![Daily Downloads](https://camo.githubusercontent.com/e4fc3f504b63862b77401865e5c2eeab4ccb5537f81c0bc5a2dbf075b460a82b/68747470733a2f2f706f7365722e707567782e6f72672f647275696466692f6d7973716c64756d702d7068702f642f6461696c79)](https://packagist.org/packages/druidfi/mysqldump-php)[![Latest Stable Version](https://camo.githubusercontent.com/80208751ba3e60728c1133a036b79a85cc40b8c00a71a3765427cef176188612/68747470733a2f2f706f7365722e707567782e6f72672f647275696466692f6d7973716c64756d702d7068702f762f737461626c652e706e67)](https://packagist.org/packages/druidfi/mysqldump-php)

This is a PHP version of `mysqldump` cli that comes with MySQL. It can be used for interacting with the data before creating the database dump. E.g. it can modify the contents of tables and is thus good for anonymize data.

Out of the box, `mysqldump-php` supports backing up table structures, the data itself, views, triggers and events.

`mysqldump-php` supports:

- output binary blobs as hex
- resolves view dependencies (using Stand-In tables)
- output compared against original mysqldump
- dumps stored routines (functions and procedures)
- dumps events
- does extended-insert and/or complete-insert
- supports virtual columns from MySQL 5.7
- does insert-ignore, like a REPLACE but ignoring errors if a duplicate key exists
- modifying data from database on-the-fly when dumping, using hooks
- can save directly to Google Cloud storage over a compressed stream wrapper (GZIPSTREAM)

Requirements
------------

[](#requirements)

- PHP 8.1 or newer with PDO - [see supported versions](https://www.php.net/supported-versions.php)
- MySQL 8.0 or newer (and compatible MariaDB)

Installing
----------

[](#installing)

Install using [Composer](https://getcomposer.org/):

```
composer require druidfi/mysqldump-php
```

Getting started
---------------

[](#getting-started)

```
