I was trying to make an automated database backup using built-in CodeIgniter $this->dbutil->backup()
.
The script is:
$this->load->dbutil();
$backup = $this->dbutil->backup(array(
'tables' => array(), // Array of tables to backup.
'ignore' => array('regencies', 'villages', 'provinces'), // List of tables to omit from the backup
'add_drop' => TRUE, // Whether to add DROP TABLE statements to backup file
'add_insert' => TRUE, // Whether to add INSERT data to backup file
'newline' => "
" // Newline character used in backup file
));
$this->load->helper('file');
$latest = md5(uniqid());
write_file(APPPATH . 'backup/'. $latest .'.gz', $backup);
The scripts run just fine. But the problem comes when i wan't to restore. It comes like this:
As a result of that i cannot restore it from CLI (mysql -u root -p dbname < db.sql
) and from Navicat/Sequel Pro.
The question is, how to restore that it to database again? (Notice that there's no quot after VALUES)