'unknown option -W' error when running mysqldump

stevland

I am trying to create a backup of a database.

mysqldump -u ost-v1-11-x -xWt1z0*8 ost-v1-11-x_ > /master-db/ost-v1-11-x__.sql

But this results in an error:

mysqldump: unknown option '-W'

I have verified all of the paths / names / password.

I can use the same code to successfully backup another database on the same server and within the same user account.

I have tried Googling the '-W' error to no avail.

Bill Karwin

When you prefix a flag with a single -, it's called a clustered option. Each letter following the - is interpreted as a flag.

This is how you can use UNIX/Linux commands like:

ls -lar

This means the same thing as:

ls -l -a -r

So when you used this flag argument:

-xWt1z0*8

It assumed you mean you were using a cluster of options:

-x -W -t -1 -z -0 -* -8

The -x option is recognized by mysqldump. It's a short alias for --lock-all-tables.

Then the program proceeded to the next option you gave: -W. On Windows, this is a short alias for the --pipe option, but on UNIX/Linux/Mac, the option is not recognized.

I'm not sure what you intended by the option -xWt1z0*8 but I would guess that's supposed to be a password. If so, you should use the -p flag, followed by your password.

mysqldump -u ost-v1-11-x -pxWt1z0*8 ...

Here's where mysqldump does something that breaks the conventions for clustered options. The -p option is prefixed with a single -, and yet the letters that follow it are not also interpreted as options. They're interpreted as the password.

If you want to make your usage more clear, stop using short options. Use only long option format:

mysqldump --user=ost-v1-11-x --password=xWt1z0*8 ...

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Error: Unknown option -g when running JMeter

Unknown Option Flag when running with sudo

Unknown error when running program

Mysqldump - Error 1049 unknown database [db] when selecting the database

When running ng generate class customer -type=model, receiving an error "Unknown Option: 'e'

“invalid option” error when running cucumber with “--retry”

awk: unknown option -w ignored

selenium giving an unknown error when adding --headless option

Unknown cmdlets error when running PowerShell script with Python

Unknown command error in Jenkins when running Cake script using Powershell

ERROR Unknown error when running consumer: org.apache.kafka.common.errors.SerializationException: Unknown magic byte

Running --inspect-brk gives error "ReferenceError: Unknown option: .debug."

Unknown tag (form:option) error

Error: "No such option: -l" when running yt-dlp

mysqldump: [ERROR] unknown variable 'delayed-insert=FALSE'

'Error opening terminal: unknown.' error when running a command in SSH server through Python

Error when compiling a static library using Swift "unknown option character `X' in: -Xlinker"

Newman Docker error: unknown option `--url'

iptables -j NFQUEUE unknown option error

git stash apply unknown option: -encodedCommand error

sed fails with "unknown option to `s'" error

Angular CLI "Unknown option: '--sourcemap'" error

Flask PyMongo connection error: Unknown option connect

socat error - unknown option "proxyport:8080"

Emacs printing: Error - unknown option "J"

Unknown error when running train.py or model_main.py

Unknown operation error when running Jolie program using Interpreter in Spring Boot

HIVE_UNKNOWN_ERROR when running AWS Athena query on Glue table (RDS)

Getting 'E/launcher - spawn Unknown system error -86' when running chrome driver with protractor