Solved

MySQL: Password has question mark in it

Posted on 2014-01-20
6
490 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 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (http://www.sqlite.org/), A SQLite Tidbit: Quick Numbers Table Generation (http://www.experts-exchange.com/A_3570.htm…
All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

730 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