Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

mysqldump worked fine just yesterday. Today I tried to dump a database and got this error message

mysqldump: unknown option '--:q'

Nothing helps, I checked all the parameters, runned "mysqldump -h", "mysqldump" without options - always the same result.

I suppose the executable is corrupted in some way or .. I really don't know. I think maybe I should try to reinstall the mysqldump but I`m not sure how to do it without breaking the currently working mysql server to stop.

Console mysql client is working fine. MySql version is 5.1.54-1. The server is Ubuntu 11.04

share|improve this question
Please tell us what you were running. We can't shed any light on the failure of a command we can't see. – MadHatter Mar 14 '12 at 16:16
mysqldump without any options gives me this error too. – gotha Mar 14 '12 at 16:29
What, just mysqldump with no options or flags? – MadHatter Mar 14 '12 at 16:32
yes, this was the case. I found my problem, thank you for your time. – gotha Mar 14 '12 at 16:34
up vote 6 down vote accepted

My guess would be someone was editing the file with vi, tried to quit (:q) while in writing mode, didn't notice and then saved the file. If this is the case edit the file and remove the extra ":q" characters.

Edit: Is there an alias for mysqldump or another script with the same name in the current path (which mysqldump)?

share|improve this answer
Yes, this was the problem. While editing the config file my.cnf "someone" typed accidently ":q". After I removed it, everything is ok. Thank you – gotha Mar 14 '12 at 16:33

The error means that somewhere in your command you've written a switch like --:q.

Also, instead of --q, consider -q, or it's full switch --quick. Or perhaps you were trying to do the quote command? In which case -Q or --quote would suffice.

share|improve this answer
the problem is that i am typing just > mysqldump and I hit enter. The same error message appears – gotha Mar 14 '12 at 16:28
Edit your original post with the command you're trying to do. We'll help you debug it. – qweet Mar 14 '12 at 16:29

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.