Skip to content

Instantly share code, notes, and snippets.

View joshopkins787's full-sized avatar

joshopkins joshopkins787

  • US
View GitHub Profile
@joshopkins787
joshopkins787 / .my.cnf
Last active October 30, 2019 19:39
Database Backup script for MariaDB/MySQL
# MySQL/mariaDB secure authorization file.
#
# To not have to put the password as an argument to the mysql commands, i.e. we don't want to
# use the -p option. Instead use a .my.cnf file in the home dir of the user you are running this
# script as, i.e. /root/.my.cnf if running as root. This way you can securely run mysqldump as
# root without the password being exposed in the process list. First create a .my.cnf in the home
# dir of root and make sure only root can read or change it by running the following three commands:
#
sudo touch /root/.my.cnf
sudo chown 0:0 /root/.my.cnf