Solved

MySQL: Password has question mark in it

Posted on 2014-01-20
6
476 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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 83

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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

A lot of articles have been written on splitting mysqldump and grabbing the required tables. A long while back, when Shlomi (http://code.openark.org/blog/mysql/on-restoring-a-single-table-from-mysqldump) had suggested a “sed” way, I actually shell …
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 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

15 Experts available now in Live!

Get 1:1 Help Now