Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

mysqldump - output.

Posted on 2010-09-01
7
Medium Priority
?
2,551 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 60

Accepted Solution

by:
Kevin Cross earned 2000 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 60

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

661 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