Skip to main content

Primary links

  • Home
  • AI
  • Kubernetes
  • Incus
  • Ansible
  • Terraform
  • OpenStack
  • Virtualization
  • Linux
  • SmartHome
  • HowTo

Misc

  • Linux
  • Hardware
  • Programming
  • Databases
    • MySQL / MariaDB
      • Copy DB
      • Create DB
      • Export / Import
      • Percona
      • Queries
      • Reset root password
      • galera
    • Oracle
    • MS SQL
    • PostgreSQL
  • Multimedia
  • Windows

Cloud

  • OpenStack
  • cloud-config
  • nextcloud

Virtualization

  • Virtualization
  • Incus
  • Docker
  • KVM
  • Kubernetes
  • LXC
  • LXD
  • QEMU
  • VMware
  • VirtualBox
  • multipass
  • podman
  • vagrant
  • XEN

Network

  • DNS
  • Firewall
  • Linux
  • OpenvSwitch
  • SSL
  • VLAN
  • VPN
  • iPXE
  • namespaces
  • nmcli
  • tcpdump

Storage

  • CEPH
  • DRBD
  • LVM
  • S3
  • ZFS
  • btrfs

Automation / CI/CD

  • Install
  • Ansible
  • GitLab
  • LLM
  • Preseed
  • Puppet
  • Terraform
  • Ubuntu autoinstall

Monitoring / Visualisation

  • Grafana
  • Icinga
  • Prometheus
  • Monitoring
  • ELK
  • mermaid
DB_HOST=localhost
DB_NAME=db1
DB_USER=root
DB_PASS=pass1234

Export DB

mysqldump --host=${DB_HOST} --password=${DB_PASS} --user=${DB_USER} ${DB_NAME} | \
  bzip2 --best > $(hostname -f)_${DB_NAME}_$(date -I).sql.bz2

# export all databases
mysqldump --host=${DB_HOST} --port=${DB_PORT} --user=${DB_USER} --password=${DB_PASS} --all-databases | \
  bzip2 > db_$(date -I)_$(date +%F_%H%M%S).sql.bz2

# --no-tablespaces
# --lock-tables=false

Import DB

# from bz2
bzcat /tmp/db_dump_${DB_NAME}.sql.bz2 | mysql --host=localhost --user=${DB_USER} --password=${DB_PASS} ${DB_NAME}
# from sql
mysql --host=localhost --user=${DB_USER} --password=${DB_PASS} ${DB_NAME} < dump.sql

Import (bz2)

bzip2 -dc dump.sql.bz2 | mysql --user=${DB_USER} --password=${DB_PASS} ${DB_NAME}
Profiles GitHub StackOverflow LinkedIn Xing
Contact Imprint
© panticz 2026

Cookie-Einstellungen

Diese Website nutzt eingebettete Inhalte von Drittanbietern (z.B. YouTube, SoundCloud). Beim Laden dieser Inhalte werden Daten an die jeweiligen Anbieter übermittelt. Datenverarbeitungserklärung