Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

How to escape ! in password?

Solution 1:

Use single quotes around the password like this: -p'one_@&!two'

To put it in an alias, you'd do something like:

alias runmysql='mysql -umyuser -p'\''one_@&!two'\'''

Solution 2:

-bash: !two: command not found

You also need to escape the & character:

$ mysql -umyuser -pone_@\&\!two

Solution 3:

If you never use the ! history features, it might be more convenient to simply disable them (with set +H in your bashrc).

Tags:

Linux

Mysql

Bash

Related

Remove/hide client sender ip from postfix? Internal DNS inside Amazon AWS VPC How to set environment variable in systemd service? How to get all fingerprints for .ssh/authorized_keys(2) file Is there such a thing as a 'quick' format for ext4? DNS - NSLOOKUP what is the meaning of the non-authoritative answer? Command to remove computer from non-existant domain How to avoid lftp Certificate verification error? Dynamic proxy with nginx based on url param GPO push install fails with error code 1603 launchctl: Error unloading: org.apache.httpd windows QUEUE MESSAGES error on open - The list of messages cannot be retrieved. Error: Access is denied

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy