Skip to main content

Primary links

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

Misc

  • Linux
  • Hardware
  • Programming
  • Databases
  • 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

MySQL / MariaDB Database

Login

mysql -u root -p

Optimize all databases

mysqlcheck --optimize --all-databases --host=localhost --user=${DB_USER} --password=${DB_PASS}

Links
phpMyAdmin - phpMyAdmin downloads

GUI

apt-get install -y mysql-admin

Allow access from outsice

sed -i 's|bind-address|#bind-address|g' /etc/mysql/my.cnf 
/etc/init.d/mysql restart

Allow access to database magento for user dbo_magento from any host

GRANT ALL PRIVILEGES ON magento.* TO  dbo_magento@'%' IDENTIFIED BY 'your_pass' 

# dont LOCK TABLE on export / import
mysqldump  --single-transaction --quick --skip-trigger ...

Export structure from a single table

mysqldump --no-data ${DB_NAME} ${TABLE_NAME} > ${DB_NAME}.${TABLE_NAME}.$(hostname).$(date -I).sql

Drop all tables from typo3_cms schema

DB_USER=foo
DB_PASS=bar
DB_NAME=db1
mysqldump -u ${DB_USER} -p${DB_PASS} --add-drop-table --no-data ${DB_NAME} | grep ^DROP | mysql -u ${DB_USER} -p${DB_PASS} ${DB_NAME}

DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET utf8 COLLATE utf8_general_ci;

SSL
http://mysqlserverteam.com/ssltls-and-rsa-improvements-for-openssl-linked-mysql-5-7-binaries/

SSH tunnel

ssh -C -L 3306:db.example.com:3306 foo@gw.example.com -N
echo "show databases;" | mysql --host=127.0.0.1 --port=3306 --user='user' --password='pass'

Report / Tuning
http://www.mysqlcalculator.com/
http://www.cyberciti.biz/faq/mysql-server-status-with-mysqlreport-report-script/
https://github.com/major/mysqltuner-perl

PL / SQL

View all DBA objects (all tables from HR)

select *
from dba_objects
where OWNER = 'HR'
and OBJECT_TYPE = 'TABLE'

Remove non numeric char

select REGEXP_REPLACE(coll, '[^[:digit:]]', '')
from TABLE
sql
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