MySQL Forums
Forum List  »  Backup

Re: mysqldump and mediawiki
Posted by: Joshua Whopper
Date: June 04, 2012 04:16PM

Following code is used to dump all the DBs on my server (which is a localhost), only "decorative" names change
$path, $psw and skt (the socket path) are defined elsewhere since they never change

[...]
$file_datetime = date('Ymd') . '-'. date('His');
$datetime_file = 'Wiki_'.$file_datetime;
$dbnamenew = 'Wikidb';
$dbname = 'wikidb';
$dest = $path.'Wiki_'.$file_datetime.'.sql';
$command ='/usr/bin/mysqldump -u root -p'.$psw.' -S '.$skt.' '.$dbname.' >'.$dest;
write_result($dbnamenew,$datetime_file);
exec($command, $out, $err);
if ($err){die('<br /><b class="die">Error: Check the dump command arguments for wikidb</b> ');}
[...]

write_result does nothing serious :)

function write_result ($z_name,$datetime_file) {
echo "<br /><b class='write'>Dumping <span style= 'color:#000099;'>$z_name</span> data, resulting file is --->&nbsp;&nbsp;&nbsp;<span style='color: #3B7149;'>".$datetime_file."</span></b><br />";
}

Options: ReplyQuote


Subject
Views
Written By
Posted
3932
May 21, 2012 02:12PM
1433
June 04, 2012 03:39PM
1616
June 04, 2012 03:49PM
1738
June 04, 2012 04:03PM
Re: mysqldump and mediawiki
1715
June 04, 2012 04:16PM
1664
June 30, 2012 04:23AM
1454
July 03, 2012 10:01AM
1366
July 03, 2012 11:52AM
1475
June 15, 2012 09:58AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.