PHPackages                             choval/mybkp - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. choval/mybkp

ActiveProject[File &amp; Storage](/categories/file-storage)

choval/mybkp
============

PHP script to backup mysql databases

v1.0.4(7y ago)020MITPHP

Since Mar 15Pushed 7y agoCompare

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

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

mybkp
=====

[](#mybkp)

Lots of systems and platforms use MySQL for their database needs. The danger rises when they run as a single instance, with no redundancy nor backup strategies. This script aims to help users to create regular backups of their databases.

Usage
-----

[](#usage)

```
./mybkp [config_files]
```

Example:

```
./mybkp config.ini config2.ini
```

The following `user cron` runs every day at 4AM.

```
0 4 * * * php /path/to/mybkp config.ini
```

Output example:

```
Database
========
 Connection: gym_admin@localhost
     Server: 10-MariaDB (Debian) x86_64 debian-linux-gnu
    Schemas: 11
     Tables: 468
       Size: 876 MB
        SSH: gyms

Backup
======
    Schemas: 3
     Tables: 3
       Size: 0.3 MB
     Output: /mybkp/dumps/localhost/
 Disk space: 58484 MB
       Mode: full
   Compress: Yes

> BACKING UP SCHEMA cliente_001 TABLE actividad - OK
    /mybkp/dumps/localhost/cliente_001/20190119/actividad.sql.gz [0.1 MB]

> BACKING UP SCHEMA cliente_002 TABLE actividad - OK
    /mybkp/dumps/localhost/cliente_002/20190119/actividad.sql.gz [0.1 MB]

> BACKING UP SCHEMA cliente_003 TABLE actividad - OK
    /mybkp/dumps/localhost/cliente_003/20190119/actividad.sql.gz [0.1 MB]

```

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

[](#requirements)

Software:

- PHP 7+
- MYSQL CLIENT 5+
- GZIP
- SSH \[1\]

Credentials

- MySQL user with access to information\_schema
- SSH user with access to MySQL binaries \[1\]

\[1\] Required if connecting through an SSH session

Recommendations
---------------

[](#recommendations)

The config file accepts passwords but not certificates, it is suggested to setup automatic login for MySQL and SSH.

- Store the MySQL password in an option file. [Reference](https://dev.mysql.com/doc/refman/8.0/en/password-security-user.html).
- SSH configuration file. [Reference](https://linux.die.net/man/1/ssh-copy-id).

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

[](#configuration)

```
; This is the default configuration for mybkp

[dump]

; Databases to ignore.
ignore_schemas[] = example
ignore_schemas[] = mysql

; The databases to dump. If not specified all accesible databases are dumped.
; Wilcard * (asterisk) can be used to match partial names
;dump_schemas[] =

; Tables to ignore. * (asterisk) wildard can be used to match partial names.
ignore_tables[] = bkp_*

; Tables to dump.
; If specified, all other tables will be ignored.
; If not specified, all tables will be dumped except the ignored ones.
;dump_tables[] = queries

; Output folder where to write the dumps. Disk space will be checked before dump.
; The default output is a _dumps_ directory in the current working directory (will be created if it doesn't exist).
; Examples:
; - dumps/[mysql_host]/[yearmonthdate]/[table].sql.gz
; - dumps/[mysql_host]/[yearmonthdate]-[schema].sql.gz
;output_folder =

; The way to dump the database. Options are:
; - single - Each table is dumped to a separate file.
; - full - All tables are dumped to a single file. Default.
;output_mode = full

; Compress output using Gzip. This runs locally, even if ssh is configured.
; Options are: true, false. Default is true.
;compress = true

; When a table is larger than this limit, the table will be exported separately.
; Default value is 500, values are in MB.
;table_dump_limit = 500;

[mysql]

; The host to connect to, default is localhost.
;mysql_host =

; The port to connect to, default is 3306.
;mysql_port =

; The MySQL user
;mysql_user =

; The MySQL password.
;mysql_pass =

[ssh]

; When ssh is enabled, the server connects through SSH and executes the MySQL binaries remotely.
; Default option is to run local binaries.
;ssh = false

; Host to connect to, must be completed if using SSH mode.
;ssh_host =

; Port to use for SSH, if ignored the default port 22 is used.
;ssh_port = 22

; User to use for SSH, if ignored the current user is used.
;ssh_user =
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

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

Unknown

Total

1

Last Release

2612d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f7e751254e7e7b319464bd6b51c51d9d2c5fedb4c2305ceaa580f9116cbc6a11?d=identicon)[choval](/maintainers/choval)

---

Top Contributors

[![choval](https://avatars.githubusercontent.com/u/794926?v=4)](https://github.com/choval "choval (21 commits)")

---

Tags

backupmysqlmysqldumpphpssh

### Embed Badge

![Health badge](/badges/choval-mybkp/health.svg)

```
[![Health](https://phpackages.com/badges/choval-mybkp/health.svg)](https://phpackages.com/packages/choval-mybkp)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M123](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M61](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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