Código PHP:
<?php
// Developped by Dave - For Semods.net and SEF
// Enter your MySQL access data
$host= 'localhost';
$user= 'root';
$pass= 'passs';
$db= 'basededatos';
$backupdir = 'backups';
$today = getdate();
$day = $today[mday];
if ($day < 10) {
$day = "0$day";
}
$month = $today[mon];
if ($month < 10) {
$month = "0$month";
}
$year = $today[year];
$hour = $today[hours];
$min = $today[minutes];
$sec = "00";
system(sprintf(
'mysqldump --opt -h %s -u %s -p%s %s | gzip > %s/%s/%s-%s%s%s-%s%s.gz',
$host,
$user,
$pass,
$db,
getenv('DOCUMENT_ROOT'),
$backupdir,
$db,
$year,
$month,
$day,
$hour,
$min
));
echo '<body bgcolor="#336699">
<p align="center"><font color="#CC3300"><span style="background-color: #FFFFCC">Database Sucessfully Backup</span></font></p></body>';
?>
// Developped by Dave - For Semods.net and SEF
Cita:
Y no hay manera de restaurarla, la copia la puedo hacer desde myswldumper lo se pero me tarda muchisimo y este script me lo hace rapido, pero no se pq me da ese error.MySQL informa
Variable 'character_set_client' can't be set to the value of 'NULL'
Error de ejecución
SET character_set_client = @saved_cs_client;
SET character_set_client = @saved_cs_client; ->Variable 'character_set_client' can't be set to the value of 'NULL'
Variable 'character_set_client' can't be set to the value of 'NULL'
Error de ejecución
SET character_set_client = @saved_cs_client;
SET character_set_client = @saved_cs_client; ->Variable 'character_set_client' can't be set to the value of 'NULL'
Muchas gracias de antemano Besitoss