0

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->username = '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?

2
  • I think as the error states there may be an mismatch of object type which is passed to the class.. Unless we have a glimpse of the mysql_restore.class.php we can find the bug.. Can you post what the line no 215 exactly contains? Commented Aug 4, 2011 at 5:36
  • Hi kvijayahari , its working now , its mistake in the function param order Commented Aug 4, 2011 at 6:09

1 Answer 1

1
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))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.