Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

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?
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

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
Avatar of hankknight

ASKER

Neither of those ideas work for me.  I am running FreeBSD.
ASKER CERTIFIED SOLUTION
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Perhaps you can just escape it with a backslash?
mysql -u my_username -ppassword\?123 show databases

Open in new window

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

Open in new window