frank1 has asked for the wisdom of the Perl Monks concerning the following question:
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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: backuping mysql
by marto (Cardinal) on Jul 03, 2024 at 13:20 UTC | |
by frank1 (Monk) on Jul 03, 2024 at 13:27 UTC | |
by marto (Cardinal) on Jul 03, 2024 at 13:30 UTC | |
by frank1 (Monk) on Jul 03, 2024 at 14:51 UTC | |
by marto (Cardinal) on Jul 03, 2024 at 14:56 UTC | |
| |
|
Re: backuping mysql
by Anonymous Monk on Jul 03, 2024 at 16:05 UTC | |
by Anonymous Monk on Jul 03, 2024 at 19:27 UTC | |
by hippo (Archbishop) on Jul 03, 2024 at 20:57 UTC | |
by frank1 (Monk) on Jul 03, 2024 at 17:15 UTC |