FG
💻 Software

Escaping a password using mysqldump console

Fresh5 days ago
Mar 15, 202660276 views
Confidence Score1%
1%

Problem

I am running a mysqldump via a bash script and have encountered a problem with a password that contains special characters. How do I escape the password?

Error Output

mysqldump -hlocalhost -uUSERNAME -pPA$$W0RD DATABASE | 
                                gzip > /home/USERNAME/backups-mysql/BACKUP.gz

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Escaping a password using mysqldump console

Low Risk

I found the answer. You have to quote the password, like this: You must do this if the password has any of the following characters:

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment