For security reasons, it is interesting to create a specific user for MySQL Database backup with the less privileges possible.
In fact, only LOCK TABLES and SELECT privileges are requested to use mysqldump.
So it is enough to use the following SQL query:
GRANT LOCK TABLES, SELECT ON XXX.* TO 'YYY'@'localhost' IDENTIFIED BY 'ZZZ';
GRANT LOCK TABLES, SELECT ON XXX.* TO 'YYY'@'localhost.localdomain' IDENTIFIED BY 'ZZZ';
FLUSH PRIVILEGES;
With variables:
XXX: the database name
YYY: the specific backup user login
ZZZ: the specific backup user password
The following instruction allows full backup with this limited privileges user:
mysqldump -u "YYY" --password="ZZZ" --all-databases > /path/to/my/dump/file
sharing knowledge earned into design/development/technical delicate and/or difficult situations ...
Labels
Gnu/Linux
(95)
Administration
(83)
StorageHardware
(17)
Programming
(16)
WebBrowser
(15)
General
(11)
GNU/Bash
(7)
Solaris
(7)
Virtualization
(7)
C
(6)
Domotics
(6)
Musics
(5)
Raspberry
(5)
Desktop
(4)
Java
(4)
VersionControlSystems
(4)
ArtificialIntelligence
(2)
Optimization
(2)
multimedia
(2)
Arduino
(1)
Electronics
(1)
LTS
(1)
MacOS
(1)
Mechanics
(1)
Processing
(1)
Robotics
(1)
Ubuntu
(1)
Upgrade
(1)
ez-robot
(1)
No comments:
Post a Comment
Thank you for your visit, let's share your point of view: