PHPackages                             corrivate/laravel-mysqldump - 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. corrivate/laravel-mysqldump

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

corrivate/laravel-mysqldump
===========================

Artisan commands to conveniently dump and import the DB, with stripping options

4.0.0(4mo ago)3376MITPHPPHP ^8.0

Since Jan 7Pushed 4mo ago1 watchersCompare

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

READMEChangelog (4)Dependencies (1)Versions (7)Used By (0)

laravel-mysqldump
=================

[](#laravel-mysqldump)

[![logo](logo.png)](logo.png)

[![Total Downloads](https://camo.githubusercontent.com/36b6a70ce0ae6414a693c61f31e7ec662000b4e2343fcff71a1ae2a90d158dff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f727269766174652f6c61726176656c2d6d7973716c64756d70)](https://packagist.org/packages/corrivate/laravel-mysqldump)[![Latest Stable Version](https://camo.githubusercontent.com/9ba6e17a92f5573d86202a5b21499049260c227da3aeb1ad4ae9be7271c12435/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f727269766174652f6c61726176656c2d6d7973716c64756d70)](https://packagist.org/packages/corrivate/laravel-mysqldump)[![License](https://camo.githubusercontent.com/b398712547fc8244d675c99a5756c3d086ce45a51c2e3a4e3965a37a09dd9d61/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636f727269766174652f6c61726176656c2d6d7973716c64756d70)](https://packagist.org/packages/corrivate/laravel-mysqldump)

Purpose
-------

[](#purpose)

- Easily dump whole databases or specific tables, with `artisan mysql:export`
- Easily import, with `artisan mysql:import`
- Strip content from tables, for example, strip the customer data but keep the product catalog.

**IMPORTANT** Stripping content from tables does not respect foreign key constraints. Meaning, if you strip a parent table but NOT a child table that depends on the parent, and then import that file somewhere else, you're going to foreign key failures. Always make sure to also strip dependent tables.

Setup
-----

[](#setup)

Install with:

```
composer require corrivate/laravel-mysqldump
```

Configuration
-------------

[](#configuration)

Configuration is not required. You can ad-hoc decide to strip tables by using `artisan mysql:export --strip=` with a comma-separated list of tables.

If your project has a standard set of tables you usually want to strip during export, you can add those to your `config/database.php` to be stripped by default.

```
'mysql' => [
    'driver' => 'mysql',
    'url' => env('DB_URL'),
    'host' => env('DB_HOST', '127.0.0.1'),
    'port' => env('DB_PORT', '3306'),
    'database' => env('DB_DATABASE', 'laravel'),
    'username' => env('DB_USERNAME', 'root'),
    'password' => env('DB_PASSWORD', ''),
    'unix_socket' => env('DB_SOCKET', ''),
    'charset' => env('DB_CHARSET', 'utf8mb4'),
    'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
    'prefix' => '',
    'prefix_indexes' => true,
    'strict' => true,
    'engine' => null,
    'options' => extension_loaded('pdo_mysql') ? array_filter([
        PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
    ]) : [],

    // These tables will only have their schema exported, no data
    'strip_tables_on_export' => [
        'cache', 'cache_locks',
        'job_batches', 'jobs',
        'users', 'password_reset_tokens', 'sessions',
        'pulse_aggregates', 'pulse_entries', 'pulse_values',
    ],
],
```

This configuration will be applied by default when using a `stripped` mode export. If you want to run a stripped export without this configuration, pass a `--config-stripped=0` option to the command.

Note that you can combine or replace this with the `--strip-manual=your,specific,tables` option.

Usage
-----

[](#usage)

### Export

[](#export)

```
artisan mysql:export [options]
```

The default behavior is to create a gzipped file `dump.sql.gz` with an export based on your stripping configuration.

Options

- `--filename=dump.sql`: Name of the file to export to. Note that '.gz' will be appended if using the gzip option as well.
- `--gzip=1` can be set to 0 to turn off compression.
- `--mode=stripped`: perform a `stripped`, `schema` or `full` export. Default is stripped.
- `--config-stripped=1` adds the tables configured in `database.mysql.strip_tables_on_export` to the list of tables to strip. Default is 1; set to 0 if you only want to manually strip tables.
- `--strip-manual=` (OPTIONAL) accepts a comma-separated list of tables to strip. These will me merged with those from your configuration (if any).

### Import

[](#import)

```
artisan mysql:import
```

Credits
-------

[](#credits)

This package is built on top of [spatie/db-dumper](https://github.com/spatie/db-dumper). The original inspiration was the Magento packages [magerun2](https://github.com/netz98/n98-magerun2) and [mage-db-sync](https://github.com/jellesiderius/mage-db-sync).

Corrivate
---------

[](#corrivate)

(en.wiktionary.org)

Etymology

From Latin *corrivatus*, past participle of *corrivare* ("to corrivate").

### Verb

[](#verb)

**corrivate** (*third-person singular simple present* **corrivates**, *present participle* **corrivating**, *simple past and past participle* **corrivated**)

(*obsolete*) To cause to flow together, as water drawn from several streams.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance78

Regular maintenance activity

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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 ~146 days

Recently: every ~132 days

Total

6

Last Release

121d ago

Major Versions

v0.1.0 → v1.0.02024-07-29

v1.0.0 → v2.0.02024-09-25

v2.0.0 → 3.0.02025-02-25

3.0.1 → 4.0.02026-01-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/7edf7174a0f8c04f78fd1839a3d3312fd9994b09d619fb0a9cca87bab1265e9f?d=identicon)[Lau Bannenberg](/maintainers/Lau%20Bannenberg)

---

Top Contributors

[![LBannenberg](https://avatars.githubusercontent.com/u/53971840?v=4)](https://github.com/LBannenberg "LBannenberg (22 commits)")

---

Tags

laravelmysqlmysqldump

### Embed Badge

![Health badge](/badges/corrivate-laravel-mysqldump/health.svg)

```
[![Health](https://phpackages.com/badges/corrivate-laravel-mysqldump/health.svg)](https://phpackages.com/packages/corrivate-laravel-mysqldump)
```

###  Alternatives

[clouddueling/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k22.9k](/packages/clouddueling-mysqldump-php)[tpetry/laravel-mysql-explain

Get Visual MySQL EXPLAIN for Laravel.

264154.2k](/packages/tpetry-laravel-mysql-explain)[yadakhov/laradump

A mysqldump wrapper for laravel. Dump your table schemas and data into files.

2517.7k](/packages/yadakhov-laradump)[moharrum/laravel-adminer

Adminer database management tool for your Laravel application.

451.0k](/packages/moharrum-laravel-adminer)[mpyw/laravel-mysql-system-variable-manager

A tiny extension of MySqlConnection that manages session system variables

115.8k](/packages/mpyw-laravel-mysql-system-variable-manager)

PHPackages © 2026

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