Skip to content
프로젝트

소개

Pure PHP MySQL dumping utility

개발 도구

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

PHP based MySQL dump library

The library provides easy way to create MySQL dumps files. It will try to create dump through:

  1. mysqldump shell utility
  2. native PHP code

For native dumps(on hosts without shell access), it works with mysqli php extension by default, and fallbacks to old-fashioned mysql whenever mysqli isn't available.

The aim of the library is to work on as many web-hosts as possible: it requires PHP 5.2 and requires just one mysql or mysqli libraries to be available.

Features:

  • support for plain text and gzip output(whenever the dump file has .gz extension, a gzip archive will be produced)
  • support for including just particular tables from the database, excluding tables, and dumping just tables with particular prefix

ToDo:

  • add support for views and triggers
  • try how things work with databases with foreign keys constraints

Examples

Dump all tables in world database:

$world_dumper = Shuttle_Dumper::create(array(
    'host' => '',
    'username' => 'root',
    'password' => '',
    'db_name' => 'world',
));
// dump the database to plain text file
$world_dumper->dump('world.sql');

// send the output to gziped file:
$world_dumper->dump('world.sql.gz');

Dump only the tables with wp_ prefix:

$wp_dumper = Shuttle_Dumper::create(array(
    'host' => '',
    'username' => 'root',
    'password' => '',
    'db_name' => 'wordpress',
));
$wp_dumper->dump('wordpress.sql', 'wp_');

Dump only country and city tables:

$countries_dumper = Shuttle_Dumper::create(array(
    'host' => '',
    'username' => 'root',
    'password' => '',
    'db_name' => 'world',
    'include_tables' => array('country', 'city'),
));
$countries_dumper->dump('world.sql.gz');

Dump all tables except for city:

$world_dumper = Shuttle_Dumper::create(array(
    'host' => '',
    'username' => 'root',
    'password' => '',
    'db_name' => 'world',
    'exclude_tables' => array('city'),
));
$world_dumper->dump('world-no-cities.sql.gz');

관련 프로젝트 살펴보기

불러오는 중…