Solved

mysqldump - output.

Posted on 2010-09-01
7
2,265 Views
Last Modified: 2012-05-10
Hi

 I have a batch DOS where i put this
"%mysqldir%\bin\mysqldump" --user=%dbuser% --password=%dbpass% database > "%bkupdir%\%fn%_backup.sql"

It works and the file .sql is created with the data. Is it possible to have any output once the mysqldump is finished, something like 8 tables backup, 60 MB or more over if there is an error .


Thanks.
0
Comment
Question by:workflow80
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 12

Expert Comment

by:mcv22
ID: 33580284
Try using the --verbose , --show-progress-size

http://bugs.mysql.com/bug.php?id=44071

Errors should show by default. You can log those to a file using --log-error=file_name

http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_log-error
0
 

Author Comment

by:workflow80
ID: 33647168
I have this error when I run :

"%mysqldir%\bin\mysqldump" --user=%dbuser% --password=%dbpass% database > "%bkupdir%\%fn%_database.sql" --show-progress-size=1500  --verbose >out.sql --log-error=errordata.txt

mysqldump: unknown variable 'show-progress-size=1500'
0
 

Author Comment

by:workflow80
ID: 33647325
Also, inside my batch , i've changed the command like this :

"%mysqldir%\bin\mysqldump" --user=%dbuser% --password=%dbpass% --verbose >out.sql database >"%bkupdir%\%fn%_data.sql"  
The output is not created but my data dump file is created .
0
 
LVL 59

Accepted Solution

by:
Kevin Cross earned 500 total points
ID: 33697612
The --verbose from MySQL doesn't have an option to output to file that I know of, so what I would do (tested to work) is to redirect DOS output which is where the results of --verbose is being displayed/output.

Note the 2>{output.log} portion AND, no, the 2 is not a type-o. :)
What will also work is 1>{output.log} 2>&1 << this will pipe the standard output to file path specified and the 2>&1 will redirect standard error to same file as standard output.  I found with mysqldump --verbose that the standard error is what is utilized, but the second example probably your best method to use if going to add other options to try to get more detail although I am not sure which other may be helpful to you than the --verbose ... just matters what all you need.

References:
http://www.robvanderwoude.com/battech_redirection.php << command line redirection
http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html << mysqldump options

Hope that helps!
mysqldump.exe --user={username} --password={password} --verbose --result-file={output.sql} database 2>{output.log}

Open in new window

0
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 33697714
By the way, I like to use this format:

mysqldump -u root -p

This way, I never have to pass or store password in clear text as the command will prompt you on the next line and will use the * (hidden) entry format.  Just a tidbit if you were not already aware.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question