MySQL: Password has question mark in it

I do not have permissions to change my MySQL password.

It is:

Because there is a question mark in the password this fails:
mysql -u my_username -ppassword?123 show databases

Open in new window

In one line, how can pass my password, including the question mark?
LVL 16
Who is Participating?
Dan CraciunConnect With a Mentor IT ConsultantCommented:
OK. what are the delimiters that tell your shell that it should not interpret between them? In bash it's ''.

Maybe this:
mysql --user=user_name --password='password?123' --execute='SHOW DATABASES'

Note that there should be no spaces before or after =
Dan CraciunIT ConsultantCommented:
mysql -u my_username '-ppassword?123' show databases
mysql -u my_username -p'password?123' show databases

depending on your shell.

hankknightAuthor Commented:
Neither of those ideas work for me.  I am running FreeBSD.
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Terry WoodsIT GuruCommented:
Perhaps you can just escape it with a backslash?
mysql -u my_username -ppassword\?123 show databases

Open in new window

Dave BaldwinFixer of ProblemsCommented:
Does it accept your password if you do interactively like this?
mysql -u my_username -p

Open in new window

I found out yesterday that some of my more recent MySQL installs do not accept the password on the command line, they require it to be entered interactively.
hankknightAuthor Commented:
This works:
mysql --user=user_name --password='password?123' --execute='SHOW DATABASES'

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.