Solved

MySQL: Password has question mark in it

Posted on 2014-01-20
6
470 Views
Last Modified: 2014-01-20
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?
0
Comment
Question by:hankknight
6 Comments
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 39795430
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
 
LVL 16

Author Comment

by:hankknight
ID: 39795449
Neither of those ideas work for me.  I am running FreeBSD.
0
 
LVL 34

Accepted Solution

by:
Dan Craciun earned 500 total points
ID: 39795472
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 35

Expert Comment

by:Terry Woods
ID: 39795517
Perhaps you can just escape it with a backslash?
mysql -u my_username -ppassword\?123 show databases

Open in new window

0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39795562
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
 
LVL 16

Author Closing Comment

by:hankknight
ID: 39795576
This works:
mysql --user=user_name --password='password?123' --execute='SHOW DATABASES'

Open in new window

0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now