如何使用查询备份MySQL数据库,就像如何使用以下查询备份MySQL一样.
查询:
backup database DATABASENAME to disk = 'PATH'发布于 2016-09-22 05:07:16
使用mysqldump-php一种纯-PHP解决方案来复制mysqldump的功能。
<?php
require('database_connection.php');
require('mysql-dump.php')
$dumpSettings = array(
'include-tables' => array('table1', 'table2'),
'exclude-tables' => array('table3', 'table4'),
'compress' => CompressMethod::GZIP, /* CompressMethod::[GZIP, BZIP2, NONE] */
'no-data' => false,
'add-drop-table' => false,
'single-transaction' => true,
'lock-tables' => false,
'add-locks' => true,
'extended-insert' => true
);
$dump = new MySQLDump('database','database_user','database_pass','localhost', $dumpSettings);
$dump->start('forum_dump.sql.gz');
?>还请访问此链接GitHub
https://stackoverflow.com/questions/38849196
复制相似问题