MySQL Forums
Forum List  »  MySQL Administrator

Re: Mysql Command Line Client ARRGH
Posted by: Barry Galbraith
Date: October 29, 2009 05:05AM


You need a password with the -p, with no space between the -p and password, like this -ppassword.
You need to specify a database to dump --databases db1
The result-file needs to use forward slashes, or two backslashes.
--result-file="e:/xyz.sql" or --result-file="e:\\xyz.sql"

Try this line.
>mysqldump --opt -uroot -ppassword --databases dbname --result-file="e:/xyz.sql"

Use your own username and password and database name.
It works as expected on my machine.

Here's a bat file I run as a scheduled task to dump my databases.
The output file name is built with date and time, so I can have more than one of them.

@echo off
for /f "tokens=1,2" %%u in ('date /t') do set d=%%v
for /f "tokens=1" %%u in ('time /t') do set t=%%u
if "%t:~1,1%"==":" set t=0%t%
rem set timestr=%d:~6,4%%d:~3,2%%d:~0,2%%t:~0,2%%t:~3,2%
set datestr=%d:~6,4%%d:~3,2%%d:~0,2%
set timestr=%t:~0,2%%t:~3,2%
mysqldump -uroot -ppassword --result-file="d:/all_backup "%datestr%" "%timestr%".sql" --all-databases

BTW, Do I detect an Aussie accent there?

Crikey mate!

Good luck,

Options: ReplyQuote

Written By
October 28, 2009 03:21PM
Re: Mysql Command Line Client ARRGH
October 29, 2009 05:05AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.