Wednesday, June 29, 2022

MYSQLDUMP PERMISSIONS


 Href: http://www.drlock.com/blog/2006/12/22/mysqldump-permissions/

I wanted to create a user who had just enough permissions to make a SQL dump of my database for backup purposes. I hunted all over the ‘net, but no one told what permissions were needed so by trial and error I found out:

GRANT SELECT, LOCK TABLES ON *.* TO backup_user@localhost IDENTIFIED BY ‘xxx’;

Now I can have a script that runs with my backup tools that executes:

mysqldump –user backup –password=xxx –all-databases –compact | gzip -9 > db_backup.sql.gz


No comments:

Post a Comment

Install and use xorg-server on macOS via Homebrew

  The instructions to install and use xorg-server on macOS via Homebrew: Install Homebrew (if you haven't already): /bin/bash -c ...