开发者

Restore mysql database using php

开发者 https://www.devze.com 2023-03-26 06:30 出处:网络
I\'m trying to restore MySQL dump created the following way: require_once \'mysql_restore.class.php\';

I'm trying to restore MySQL dump created the following way:

require_once 'mysql_restore.class.php';
$restore_obj = new MySQL_Restore();

$restore_obj->server = 'localhost';
$restore_obj->usern开发者_C百科ame = 'root';
$restore_obj->password = '';
$restore_obj->database = 'database';
if (!$restore_obj->Execute(MSR_FILE, 'bk.sql.gz', true, false))
{
  die($restore_obj->error);
}

but its showing an error

Warning: gzuncompress() [function.gzuncompress]: data error in C:\wamp\www\nidhin\mysql_restore.class.php on line 42 Warning: Invalid argument supplied for foreach() in C:\wamp\www\nidhin\mysql_restore.class.php on line 215

Any idea what I'm doing wrong?


function Execute($param, $mode = MSR_STRING, $is_compressed = false, $split_only = false)

You inverted the params order.

It's :

!$restore_obj->Execute('bk.sql.gz', MSR_FILE, true, false))

Instead of :

!$restore_obj->Execute(MSR_FILE, 'bk.sql.gz', true, false))
0

精彩评论

暂无评论...
验证码 换一张
取 消