Re: Getting empty .sql file when we run backup code please see the code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please check the folder permission where you are storing that file.

 Thanks & Regards
Udayakumar Sarangapani
Sr. PHP Developer
CompIndia Infotech Pvt. Ltd.
Chennai.

"Science is nothing but logic..."




----- Original Message ----
From: srinivas pmm <malayappa@xxxxxxxxxxxxxxxxxx>
To: php-objects@xxxxxxxxxxxxxxx
Sent: Thursday, 10 July, 2008 1:00:43 PM
Subject: Re:  Getting empty .sql file when we run backup code please see the code


Hi Uday
we replaced with below  code
$command="mysqldump --user=$dbuser --password= $dbpass $dbname >
$filename.sql" ;
but geeting same error.

On Thu, Jul 10, 2008 at 9:16 AM, Udaya kumar <udayakumaar@ yahoo.com> wrote:

>   Use:
>
> $command="mysqldump --user=$dbuser --password= $dbpass $dbname >
> $filename.sql" ;
>
> Thanks & Regards
> Udayakumar Sarangapani
> Sr. PHP Developer
> CompIndia Infotech Pvt. Ltd.
> Chennai.
>
> "Science is nothing but logic..."
>
>
> ----- Original Message ----
> From: malayappa2000 <malayappa@nannacomp uters.com<malayappa%40nannac omputers. com>
> >
> To: php-objects@ yahoogroups. com <php-objects% 40yahoogroups. com>
> Sent: Wednesday, 9 July, 2008 8:45:33 PM
> Subject:  Getting empty .sql file when we run backup code
> please see the code
>
> Hi Guys
>
> i have the code for taking the database backup when i run the code i
> am getting empty file with out tables. fallowing is my code please
> provide some help.
>
> <?php
>
> $dbname = 'bulksms' ;
> $dbuser = 'root';
> $dbpass = '';
> $dbhost = 'localhost'; ;
>
> $connect=mysql_ connect($ dbhost,$dbuser, $dbpass);
> mysql_select_ db($db);
> //echo "jumbedb selected";
> mysql_select_ db($dbname) or die("cannot select DB");
>
> //$backupFile = $dbname . date("Y-m-d- H-i-s") . '.sql';
> $backupFile = $dbname.'.sql' ;
>
> /*
> header('Content- Description: File Transfer');
> header('Content- Type: application/ force-download' );
> header ("Content-Type: application/ octet-stream" );
> header("Content- Length: ".filesize(" $folder/$ file"));
> header('Content- Disposition: attachment; filename=' .. $file);
> readfile("$folder/ $file");
> */
> // mysqldump ---user admin ---password= $dbpass mydatabase > sql.dump
>
> //$command = "mysqldump --opt -h $dbhost -u $dbuser
> --password=$ dbpass $dbname > $backupFile" ;
> //$command = "mysqldump --opt -h $dbhost -u $dbuser
> --password=$ dbpass $dbname";
> $command="mysqldump ---user $dbuser ---password= $dbpass $dbname";
> //echo "command is".$command;
> exec($command, $retval);
>
> $user_agent = strtolower ($_SERVER["HTTP_ USER_AGENT" ]);
>
> if ( (is_integer (strpos($user_ agent, "msie"))) && (is_integer
> (strpos($user_ agent, "win"))) ){
> //header('Cache- Control: must-revalidate, post-check=0,
> pre-check=0' );
> //header('Pragma: public');
> //header('Content- Type: xxx/null');
> //header('Content- Disposition: attachment; filename="' . $backupFile
> . '";');
> } else {
> //header('Content- Type: application/ octet-stream' );
> //header('Content- Disposition: attachment; filename="' .
> $backupFile . '";');
> //header('Pragma: no-cache');
> }
> header('Content- Description: File Transfer');
> header('Content- Type: application/ force-download' );
> header ("Content-Type: application/ octet-stream" );
> header('Content- Disposition: attachment; filename=' . $backupFile) ;
> //header('Content- Length: ' . strlen($retval) );
> //readfile($ backupFile) ;
> //print_r( $retval);
> foreach($retval as $val)
> echo $val."\n";
>
> ?>
>
> Explore your hobbies and interests. Go to
> http://in..promos. yahoo.com/ groups/
>
> [Non-text portions of this message have been removed]
>
> 
>

-- 
Regards
P.M.M.Srinivas
jr Software Engineer
ID: NGH32053
Ph : +91 9849426596
Home page : www.nannacomputers. com
An ISO 9001:2000 company

[Non-text portions of this message have been removed]

    


      Bollywood, fun, friendship, sports and more. You name it, we have it on http://in.promos.yahoo.com/groups/bestofyahoo/

[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux