MySQL: Password has question mark in it

I do not have permissions to change my MySQL password.

It is:
password?123

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
hankknightAsked:
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 =
0
 
Dan CraciunIT ConsultantCommented:
Try
mysql -u my_username '-ppassword?123' show databases
or
mysql -u my_username -p'password?123' show databases

depending on your shell.

HTH,
Dan
0
 
hankknightAuthor Commented:
Neither of those ideas work for me.  I am running FreeBSD.
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

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

Open in new window

0
 
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.
0
 
hankknightAuthor Commented:
This works:
mysql --user=user_name --password='password?123' --execute='SHOW DATABASES'

Open in new window

0
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.