Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Servers
Reload this Page Mysqldump
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Servers Anything server related, Apache, MySQL, Samba, server security, sendmail, exim, etc

Reply
 
Thread Tools Display Modes
Old 06-25-2008   #1 (permalink)
copes
Just Joined!
 
Join Date: Jun 2008
Posts: 13
Mysqldump

Hello,

I'm trying to use mysqldump from php.

Here is the php im using for this:

$dbhost, $dbuser, $dbpass are present, but not show for security reasons.

PHP Code:
$path "/home/a/c/acornmedia/public_html/tools/sqlmagic/backup/";

$backupFile $dbname date("Y-m-d-H-i-s") . '.gz';
$command "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $path . $backupFile";
system($command); 
Is my actual mysqldump statement correct? I'm really new to linux. The dedicated server we rent uses ubuntu if that helps.

I'm not sure about the $path section, the person that commented on a different post wasn't clear whether this was the path to where the db should be moved to once gzipped, or where the db where it is dumped before its gzipped.

I basically want it to move the final .gz which contains the database dump to /home/a/c/acornmedia/public_html/tools/sqlmagic/backup/ which is the root path to the web area of the server.

However it doesn't work. No files get created in sqlmagic/backup/

Can anyone help?

Thanks
copes is offline   Reply With Quote
Old 06-25-2008   #2 (permalink)
wesley_morris2000
Just Joined!
 
Join Date: Jun 2008
Location: Memphis, TN
Posts: 45
I'm not a php guy, but maybe it has to do with the permissions of the script. Also, it might be the permissions of your user account on the server.
wesley_morris2000 is offline   Reply With Quote
Old 06-26-2008   #3 (permalink)
pbarclay
Just Joined!
 
Join Date: Jun 2008
Posts: 1
Try removing the space between the -p and the password variable - this is probably the reason... LEt me know how you get on
pbarclay is offline   Reply With Quote
Old 06-26-2008   #4 (permalink)
copes
Just Joined!
 
Join Date: Jun 2008
Posts: 13
yeah the problem was something to do with the password, as it was trying to use the variable for password as the database name,

I've ended up using --password=$dbpass

works fine now!

Thanks for the help.
copes is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 08:40 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0