Tag: MySQL

  • MySQL – Calculating Disk Usage Per Database

    MySQL – Calculating Disk Usage Per Database

    The answer usually lies within /var/lib/mysql/[DATABASE]. But the answer can also be found in, you guessed it, information_schema! 😀 Here’s an one-liner for you, that displays database sizes in megabytes (nice long float() included) If gigabytes are more your thing, run the following: Example output: Query on 👾

  • Kubernetes – Kubectl MySQL Client One-Liner

    Kubernetes – Kubectl MySQL Client One-Liner

    Some of my applications, if not all of them, use MySQL in some fashion. The database pod is not exposed outside it’s kube-network service and is only reachable from within it’s namespace… Troubleshooting or random database querying can be a hassle. Here’s a one-liner to help you: The container will disappear when you exit the…

  • Kubernetes – Simple CronJob for MySQL/MariaDB Backup

    Kubernetes – Simple CronJob for MySQL/MariaDB Backup

    No Secret, No Configmap, No Fuzz. Just a command and args one-liner that gets the job done, day after day, with an invaluable result on the day that you reaaaally need it. Example Backup Cron: This will create a daily job (00:00, 12AM) that runs container image “mysqldump”, generously authored by docker.io/bigtruedata. It will store…