TenangDB
π‘οΈ Backup yang Bikin Tenang - MySQL backup solution with auto-discovery and cloud integration.
Zero-configuration backup system that just works.
β‘ Installation
# One-liner install
curl -sSL https://go.ainun.cloud/tenangdb-install.sh | bash
# Install dependencies
brew install mydumper rclone mysql-client # macOS
sudo apt install mydumper rclone mysql-client # Ubuntu
sudo dnf install mydumper rclone mysql # CentOS/Fedora
π Quick Start
# 1. Get config template
curl -L https://go.ainun.cloud/tenangdb-config.yaml.example -o config.yaml
# 2. Edit with your database credentials
nano config.yaml
# 3. Run backup
tenangdb backup
βοΈ Basic Config
database:
host: your_mysql_host
username: your_username
password: your_password
mydumper:
enabled: true
backup:
databases:
- your_database1
- your_database2
# Optional: Cloud upload
upload:
enabled: false
destination: "your-remote:backup-folder"
Auto-Discovery Features:
- Binary paths (mydumper, myloader, rclone, mysql)
- Backup directories (platform-specific)
- Log locations and optimal settings
π Commands
tenangdb backup # Backup all databases
tenangdb backup --databases db1,db2 # Backup specific databases
tenangdb restore --backup-path /path/to/backup --database target_db
tenangdb cleanup --force # Clean old backups
tenangdb config # Show configuration
π§ Advanced
MySQL User Setup
-- Create dedicated user
CREATE USER 'tenangdb'@'%' IDENTIFIED BY 'secure_password';
GRANT SELECT, SHOW DATABASES, SHOW VIEW, LOCK TABLES, EVENT, TRIGGER, ROUTINE, RELOAD, REPLICATION CLIENT ON *.* TO 'tenangdb'@'%';
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, INDEX, REFERENCES, CREATE TEMPORARY TABLES, CREATE VIEW ON *.* TO 'tenangdb'@'%';
FLUSH PRIVILEGES;
Cloud Storage Setup
# Configure rclone
rclone config
# Test connection
rclone lsf your-remote:
# Enable in config.yaml
upload:
enabled: true
destination: "your-remote:database-backups"
Production Deployment
# Install system-wide
curl -L https://go.ainun.cloud/tenangdb-latest -o tenangdb
sudo mv tenangdb /usr/local/bin/ && sudo chmod +x /usr/local/bin/tenangdb
# Setup config
sudo mkdir -p /etc/tenangdb
curl -L https://go.ainun.cloud/tenangdb-config.yaml.example | sudo tee /etc/tenangdb/config.yaml
sudo nano /etc/tenangdb/config.yaml
π Details
Directory Structure
Backups: ~/Library/Application Support/TenangDB/backups/ (macOS)
~/.local/share/tenangdb/backups/ (Linux)
Structure: {backup-dir}/{database}/{YYYY-MM}/{backup-timestamp}/
Cloud: {destination}/{database}/{YYYY-MM}/{backup-timestamp}/
Compatibility
mydumper: v0.9.1+ (Ubuntu 18.04) to v0.19.3+ (macOS Homebrew)
MySQL: 5.7+, 8.0+, MariaDB 10.3+
Platforms: macOS (Intel/Apple Silicon), Linux (Ubuntu/CentOS/Debian/Fedora)
π Links
Documentation: Installation Guide β’ MySQL Setup β’ Production Deployment β’ Config Reference
Troubleshooting
Binary not found:
which tenangdb || curl -sSL https://go.ainun.cloud/tenangdb-install.sh | bash
Dependencies missing:
which mydumper myloader rclone mysql
# Install: brew/apt/dnf install mydumper rclone mysql-client
Connection failed:
mysql -h your_host -u your_user -p
SHOW GRANTS FOR 'your_user'@'%';
Debug mode:
tenangdb backup --log-level debug --dry-run
Support: Issues β’ License: MIT