Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.
@echo Check Tables
%MYSQL_BIN%\mysqlcheck -u %MYSQL_USER% -p%MYSQL_PW% -v -1 -A -c
@echo.
@echo Repair Tables (medium)
%MYSQL_BIN%\mysqlcheck -u %MYSQL_USER% -p%MYSQL_PW% -v -1 -A -r -m
@echo.
@echo Analyze Tables
%MYSQL_BIN%\mysqlcheck -u %MYSQL_USER% -p%MYSQL_PW% -v -1 -A -a
@echo.
@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 stackoverflow.com Jul 17 '11 at 4:54

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

2 Answers 2

up vote 1 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

 
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.