Ver Mensaje Individual
  #2 (permalink)  
Antiguo 17/03/2012, 05:10
gomminola
 
Fecha de Ingreso: mayo-2008
Mensajes: 253
Antigüedad: 16 años
Puntos: 8
Respuesta: Problema con srcipt backup mysql

buens de nuevo pero es que no encuentro porque cuando intento restaurar la bd me sigue dando el error

Cita:
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'
he leido que a la hora de hacer el backup no deben de estar marcado los insert extendidos, pero no encuentro la forma que no los marque.

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
En fin si algun programador caritativo puede ayudarme !! gracias y buen fin de semana