6

I am trying to connect to mysqlshell client from my linux command line when I try to connect, using

mysqlsh mysql -h IP -u user -ppassword -e "show databases"
mysqlsh mysql -h IP:port -u user -ppassword -e "show databases"
mysqlsh mysql -h IP:port -u -port 3306 user -ppassword -e "show databases"

I get the below error.

Conflicting options: provided host differs from the host in the URI.

Could you please help with this?

1 Answer 1

16

The proper format of mysqlsh is a bit different:

mysqlsh --user=user --password=password --port=5721 --host <hostname or IP>
Sign up to request clarification or add additional context in comments.

4 Comments

This seems like just rearranging the same args and giving some of them double-hyphen notation instead of single-hyphen and an initial. It didn't change the error I'm getting at all. The question is, the host in which URI? I only see one hostname here so I need to know where it's reading a hostname from.
@Philip, please check carefully my and OP commands and you will see the difference.
Empirically I have a situation where neither the OP's format works nor does yours, and both fail in with the same message. Fortunately for some people your solution has worked. Funny enough my workaround was to use the username@host format and enter the password manually, but that's obviously not OK if full automation is needed.
@Philip, seems you have a questions. Feels free to ask it, explaining the situation in details. stackoverflow.com/questions/ask Also if you have answer/solution answer own questions.

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.