0

I am trying to access mysql via command line, but when I enter the command to access my DB, I get the mysql --help text as an output. Here is what I am typing in:

mysql -h localhost -u USER -p PASSWORD DB_NAME

I have confirmed all of my credentials are correct, but when I run that, I get the following:

mysql  Ver 14.14 Distrib 5.5.32, for Linux (x86_64) using readline 5.1
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Usage: mysql [OPTIONS] [database]
  -?, --help          Display this help and exit.
  -I, --help          Synonym for -?
  --auto-rehash       Enable automatic rehashing. One do...

I have also tried running it using php exec. I see the same output that way also. Anyone have any thoughts on why this is occurring?

1
  • 1
    Recheck the exact syntax of the -p option Commented Nov 15, 2013 at 22:56

2 Answers 2

3

Remove the space between your -p flag and your actual password, or use --password=PASSWORD. From the man page:

If you use the short option form (-p), you cannot have a space between the option and the password.

Sign up to request clarification or add additional context in comments.

Comments

1

Don't include PASSWORD in the command. The "-p" is all you need. It will prompt you for the password without showing the characters you type.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.