MySQL dump - password not found / invalid #399
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#399
Loadingβ¦
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
First, I just discovered Borg and Borgmatic, thanks for this, it looks really great ! I'm using Hetzner as backup storage for my raspberry, but it seems their is a bug with mysqldump step.
Steps to reproduce (if a bug)
Create a backup with the following configuration
Actual behavior (if a bug)
Include (sanitized)
--verbosity 2
output if applicable.Expected behavior (if a bug)
As mysql password is given in configuration, I expect it to backup my database.
Other notes / implementation ideas
I excluded the bad credential password option when looking how borgmatic create MySQL dumps. It seems it use the
MYSQL_PWD
environment variable. So I tested :and this works on my shell. Am I missing an option, or is this a bug in borgmatic/borg ?
For what it worth, my password does not contains spaces/accentuations, only characters and numbers.
As a workaround, I can still use
--skip-comments --order-by-primary -psecurePassword
and it works. From my understanding, it seems that the MYSQL_PWD variable is not defined/invalid.MySQL user permissions :
Environment
borgmatic version: [version here]
Use
sudo borgmatic --version
orsudo pip show borgmatic | grep ^Version
borgmatic installation method: [e.g., Debian package, Docker container, etc.]
installed with pip3
Borg version: [version here]
Use
sudo borg --version
Python version: [version here]
Use
python3 --version
Database version (if applicable): [version here]
Use
psql --version
ormysql --version
on client and server.operating system and version: [OS here]
Raspberry pi OS on a raspberry pi 4
I have the exact issue as well with this mysql hook.
@djdembeck, what version of borgmatic are you using? There was a MySQL-specific fix (#470) in borgmatic 1.5.22 that may be relevant here.
I'm closing this due to inactivity. However, please feel free to re-open it or file a new ticket if you have more information. Thanks!
i stumbled across this issue as i experienced the exact same problem. i finally figured the reason for this to happen:
When you run
sudo borgmatic
and have a/root/.my.cnf
with credentials in place, the password defined in /etc/borgmatic/config.yaml gets overwritten - but not the user.For example having a /root/.my.cnf with
and a borgmatic-conf with:
will result in a
mysql --user borg
but with passwordroot
Ah, excellent sleuthing! I'll reopen this to see if there's anything that can be done about it on the borgmatic side of things.
Edit: This may be relevant for
mysql
password setting / defaults file overriding.. https://unix.stackexchange.com/questions/205180/how-to-pass-password-to-mysql-command-lineI ended up just documenting around this for now. While I did consider passing
--no-defaults
to MySQL/MariaDB to make it ignore files like~/.my.cnf
, in my experience it often breaks things for users relying on that kind of configuration. If anything, the trend in borgmatic is adding more ways to pass in credentials rather than taking them away.