Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Any idea why I am seeing this error message? This script works fine on a ever so slightly older version of MySQL running on a different server with a similar config.

:: check/analyze/repair/optimize
@echo Check Tables
%MYSQL_BIN%\mysqlcheck -u %MYSQL_USER% -p%MYSQL_PW% -v -1 -A -c
@echo Repair Tables (medium)
%MYSQL_BIN%\mysqlcheck -u %MYSQL_USER% -p%MYSQL_PW% -v -1 -A -r -m
@echo Analyze Tables
%MYSQL_BIN%\mysqlcheck -u %MYSQL_USER% -p%MYSQL_PW% -v -1 -A -a
@echo Optimize Tables
%MYSQL_BIN%\mysqlcheck -u %MYSQL_USER% -p%MYSQL_PW% -v -1 -A -o

Error: C:...\MySQL Server 5.5\bin\mysqlcheck doesn't support multiple contradicting commands

share|improve this question

migrated from Jul 17 '11 at 4:54

This question came from our site for professional and enthusiast programmers.

up vote 3 down vote accepted

At least one of your switches is likely now mutually exclusive to another in one or more calls to mysqlcheck.

Look each of them up (-v, -1, -A, -c, -r, -m, -a, -o), figure out each of them does, and figure out how to break them out into separate calls to mysqlcheck, so they aren't contradicting each other.

As a hypothetical example, -v combined with -r might mean "set the clock back and set the clock forward" - an instruction that could arguably interpreted to be contradictory. If you want to do both operations, you must do them in two sequential calls to mysqlcheck, in the order you which require them to run.

share|improve this answer
Thanks Mike! Explained perfectly. I'll have a crack at this tomorrow and let you know when it's fixed ;-D – Chris Jul 14 '11 at 18:51

As said before, the switches that you use are mutually exclusive: so you want to get rid of one option. Try this:

mysqlcheck -u %MYSQL_USER% -p%MYSQL_PW% --auto-repair --optimize --all-databases

If I'm not mistaken, you get the same with just one command.

share|improve this answer

Your Answer


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.