Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MySQL: Password has question mark in it

Posted on 2014-01-20
6
Medium Priority
?
508 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 35

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 35

Accepted Solution

by:
Dan Craciun earned 2000 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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
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 84

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 your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

636 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