Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I begin by launching the MySQL command line tool:

mysql --user=myusername --password=mypassword --silent --force -b

The last -b option is used to disable beep on error.

Then I choose a database:

use Mydatabasename;

Then I execute SQL form a file like this:

source c:\x\y\z\myfile.sql

That's when things go slowly. I've executed part of the file before so the console is filled with duplicate row errors which slow execution badly. I get 5-10 statements executed per second. Without duplicate rows the code executes tens of thousands of statements (30k+) every 5 seconds.

I need to do this since the file is large and I can't execute it in one go.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Here is the problem. The OS has two modes to print things

  • stdout
  • stderr

The --silent only affects stdout. How do you nail stderr?

Try one of the following, and see if it works:

mysql --user=myusername --password=mypassword --silent --force -b 2> nul
mysql --user=myusername --password=mypassword --silent --force -b --tee=nul

Give it a Try !!!

CAVEAT : I have dealt with something this before when answering a question about mysqldump : How to log verbose output from mysqldump?

share|improve this answer
    
Does "2>nul" mean redirect the second output stream (stderr) to nothing? I just executed my big script and I think it's still going through the duplicates (didn't use silent just 2> nul). I think I'll need to split the source file... Many thanks. –  Mzn Oct 19 '12 at 18:02
1  
Yes, output to NUL writes absolutely nothing. You could do 2>stderr.txt if you want. –  RolandoMySQLDBA Oct 19 '12 at 18:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.