/    Sign up×
Community /Pin to ProfileBookmark

data is not saving in databackup file

I have Mysql 5.

I am php 5 / mysql 5 ..

I am creating database backup file by using foloowing script..
<?php

$command = “mysqldump –opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $filename”;
system($command);
?>

File is creating but with no data..
IS there any persmission/ Setting with mysql..

Mangesh

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@chazzyDec 30.2006 — A few notes:

if you use -p, the password needs to be immediately after it, no space so if the password is "bob" then you'd have -pbob

you'll need to specify the full path

if you want to put it into a file, you need to put it before gzipping, generally (depends on distro)
[code=php]
<?php
//assuming its in /usr/bin/mysql
$command = "/usr/bin/mysql/mysqldump --opt -h $dbhost -u $dbuser -p$dbpass $dbname > $filename | gzip $filename";
system($command);
?>
[/code]
×

Success!

Help @joshi_mangesh spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...