MySQL/MariaDB comandi utili
mouse 1565 · person cloud · link
Last update
2024-08-20
2024
08-20
« — »

backup all databases

1
2
3
4
5
6
7
8
# save
mysqldump \
  -u root -pROOTPASS \
  --all-databases --single-transaction | \
  xz > dbs.sql.xz

# restore
zcat dbs.sql.gz | mysql -u root -pROOTPASS

abilita nuovo utente

1
2
3
# sudo mariadb
CREATE USER 'nome'@'localhost' IDENTIFIED BY 'pass-utente';
GRANT ALL PRIVILEGES on *.* to 'nome'@'localhost';