aws rds mysql time_zone

Need to change your time_zone? NOW() not reflecting the correct time? Do the following:

  • Create a new parameter group and edit time_zone
  • Modify your RDS instance with the new group
  • Reboot your RDS instance

https://aws.amazon.com/premiumsupport/knowledge-center/rds-change-time-zone/

Advertisements

ubuntu mysqldump to azure storage

mysqldump user

create user 'dumper'@'localhost' identified by 'password';
GRANT ALL PRIVILEGES ON *.* To 'dumper'@'localhost';

my.cnf

sudo vim /etc/mysql/my.cnf
[mysqldump]
user=dumper
password=secret

root is owner and group of .my.cnf

Test it

mysqldump --all-databases > /home/user/backups/db-backup.sql

Install Azure-cli

Backup script

sudo chmod a+x /home/user/dump.sh
whereis mysql
whereis node
whereis azure

Make sure you reference the full Azure CLI & Node JS path for the azure command. The cron doesn’t know where they are.

Test it

sh dump.sh

crontab

Let the machine do the work.

references
azure example script
– azure cli commands
azure-cli github
mensfeld separate database dumps