Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it L'avatar di strae
    Registrato dal
    Apr 2008
    Messaggi
    407

    [mysql] Backup database tramite passthru('mysqldump...')?

    ciao ragazzi!

    io stò provando in tutti i modi ad avere un sistema di backup affidabile, ho provato la classe mysql_backup() che, dopo alcune modifiche qua e là, funzionerebbe anche bene.. se non fosse che non mi differenzia bene i tipi di campi, ad esempio se ho dei decimal nel file di backup me li scrive come real.

    sono riuscito a modificarla per farli riconoscere almeno i campi enum, ma i decimal proprio non riesco a farlgieli riconoscere, quindi, provando con un esempio preso in rete:


    Codice PHP:
    $command "mysqldump --opt -h $host -u $user -p$pass $nomeDb | gzip > $backupFile";
    passthru($command); 
    mi crea si il file.gz, ma il suo contenuto è solo:

    Codice PHP:
    -- MySQL dump 10.10
    --
    -- 
    Hostlocalhost    Database/*nome_mio_database*/
    -- ------------------------------------------------------
    -- 
    Server version    5.0.18

    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;
    /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
    /*!40103 SET TIME_ZONE='+00:00' */;
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
    /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */
    dove sbaglio?
    teoricamente se il problema fosse che non riesce ad eseguire il comando dovrebbe crearmi un file completamente vuoti, idem se sbagliassi qualche path, o se il collegamento al db fallisse..

    indi per cui, l'errore dove potrebbe essere?
    You HAVE to assume your visitor is a maniac serial killer, out to destroy your application. And you have to prevent it.
    I can accept failure, everyone fails at something - But I can't accept not trying.

  2. #2
    Utente di HTML.it L'avatar di strae
    Registrato dal
    Apr 2008
    Messaggi
    407
    ops.. colpa mia, mi connettevo con l'utente coi permessi limitati, usando il super user lavora bene
    You HAVE to assume your visitor is a maniac serial killer, out to destroy your application. And you have to prevent it.
    I can accept failure, everyone fails at something - But I can't accept not trying.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.