You must do this if the password has any of the following characters:
* ? [ < > & ; ! | $ ( )
🟥 Important Note: Make sure there is no space after -p
and MySQL password.
Use quotes around the password:
mysql -u root -p'Special*Character?Password()'
Use bash variables
P='Special*Character?Password()'
mysql -u root -p$P
Backslash (\) those special chars.
mysql -u root -pSpecial\*Character\?Password\(\)