trouble with mysqldump

J

Junkone

when i try
program="C:\\Program Files\\MySQL\\MySQL Server 5.1\\bin\
\mysqldump.exe"
irb(main):008:0> system(program)
Usage: mysqldump [OPTIONS] database [tables]
OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR mysqldump [OPTIONS] --all-databases [OPTIONS]

it works and is able to launch myssqldump.exe
so i want to setup a backup process using ruby.
however the next step does not work. dont know why?

destination="e:\\tradingtools\\databackup\\#{dt}.sql"
system("#{program} --user=root --password=password dbtrader
#{destination}")

error that i get is
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
 
J

Jonathan Nielsen

[Note: parts of this message were removed to make it a legal post.]

destination="e:\\tradingtools\\databackup\\#{dt}.sql"
system("#{program} --user=root --password=password dbtrader

error that i get is
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
You'll need to wrap the program name in quotes to use it with arguments like
that. Try instead:
system("\"#{program}\" --user=root --password=password dbtrader >
\"#{destination}\"")

Ideally you would pass each argument to system as a separate argument, like:
system(program,"--user=root","--password=password", etc)
But I don't know how to pipe the output of this to a file... perhaps someone
else on the list can help.

-Jonathan Nielsen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top