Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export only one table from database? #219

Open
bag7dad opened this issue Feb 23, 2021 · 1 comment
Open

export only one table from database? #219

bag7dad opened this issue Feb 23, 2021 · 1 comment

Comments

@bag7dad
Copy link

bag7dad commented Feb 23, 2021

I am thinking about limit all other tables

//export table4

use Ifsnop\Mysqldump as IMysqldump;

try {
    $dump = new IMysqldump\Mysqldump('mysql:host=localhost;dbname=aaaa', 'bbbb', 'cccc');
    $dump->setTableLimits(array(
    'table1' => 0,
    'table2' => 0,
    'table3' => 0,
));
    $dump->start('file/dump.sql');
} catch (\Exception $e) {
    echo 'mysqldump-php error: ' . $e->getMessage();
}

is that correct?

@garas
Copy link
Contributor

garas commented Feb 23, 2021

Try 'include-tables' => array() option.

https://github.com/ifsnop/mysqldump-php#dump-settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants