Am trying to backup a mysql database and replace the existing file. am using this module
MySQL::Backupbut its not working. am getting the following errors, tho i don't have much idea on it and its documentation is not clear
Use of uninitialized value $null in concatenation (.) or string at MySQL/Backup.pm line 103.: File name too long at db_backup.pl line 28.#!/usr/bin/perl -wT use lib '.'; use strict; use warnings; use MySQL::Backup; use File::Basename; use CGI qw/:standard/; my $host = "162db.myhost.org"; my $user = "user"; my $pwd = "password"; my $database = "dbusers"; my $backup_folder = '/usr/home/ken/public_html/srcoc'; my $mb = new MySQL::Backup($database,$host,$user,$pwd,{'USE_REPLACE' = +> 0, 'SHOW_TABLE_NAMES' => 0}); $mb->create_structure(); my $backup_db = $mb->data_backup(); my $file = $backup_db; $file .= ".sql"; if ($backup_db) { open ( UPLOADFILE, "+>$backup_folder/$file" ) or die "$!"; binmode UPLOADFILE; while ( <UPLOADFILE> ) { print UPLOADFILE; } close UPLOADFILE; } else { exit 1; }
In reply to backuping mysql by frank1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |