MariaDB: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Geist (Diskussion | Beiträge) |
Geist (Diskussion | Beiträge) |
||
(4 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
=== EASY BACKUP === | === EASY BACKUP === | ||
− | 1. | + | '''[https://mariadb.com/kb/en/mariadb-dumpmysqldump/ mariadb-dump/mysqldump]''' |
+ | |||
+ | 1. Method -> mysqldump | ||
$ '''mysqldump -u root -p –all-databases > db.sql''' | $ '''mysqldump -u root -p –all-databases > db.sql''' | ||
$ '''mysql -u root -p db < db.sql''' | $ '''mysql -u root -p db < db.sql''' | ||
$ '''du -sh db.sql''' | $ '''du -sh db.sql''' | ||
− | 2. | + | 2. Method -> mariabackup |
− | $ dnf -y install mariadb-backup | + | '''$ dnf -y install mariadb-backup''' |
− | $ mariabackup --backup --target-dir /home/backup -u root -p password | + | '''$ mariabackup --backup --target-dir /home/backup -u root -p password''' |
+ | |||
+ | 3. Method -> bash/sh -> cp all files | ||
+ | .. | ||
+ | |||
+ | ===== Find config files ===== | ||
+ | $ '''locate my.cnf''' | ||
+ | $ '''whereis my.cnf''' | ||
+ | $ '''find / -name my.cnf''' | ||
+ | |||
+ | $ '''mysql --help --verbose | grep "my.cnf"''' | ||
+ | or | ||
+ | $ '''mysqld --help --verbose | grep "my.cnf"''' | ||
+ | |||
+ | Default options are read from the following files in the given order: | ||
+ | '''/etc/my.cnf''' | ||
+ | '''/etc/mysql/my.cnf''' | ||
+ | '''/usr/etc/my.cnf''' | ||
+ | '''$MYSQL_HOME/my.cnf''' | ||
+ | '''[datadir]/my.cnf''' | ||
+ | '''~/.my.cnf''' | ||
===== SYSTEMCTL MARIADB ===== | ===== SYSTEMCTL MARIADB ===== | ||
− | $ systemctl stop mariadb | + | '''$ systemctl stop mariadb''' |
− | $ systemctl start mariadb | + | '''$ systemctl start mariadb''' |
− | $ systemctl restart mariadb | + | '''$ systemctl restart mariadb''' |
===== INIT SECURE DB ===== | ===== INIT SECURE DB ===== |
Aktuelle Version vom 15. Juni 2022, 15:08 Uhr
Inhaltsverzeichnis
EASY BACKUP
mariadb-dump/mysqldump
1. Method -> mysqldump $ mysqldump -u root -p –all-databases > db.sql $ mysql -u root -p db < db.sql $ du -sh db.sql
2. Method -> mariabackup $ dnf -y install mariadb-backup $ mariabackup --backup --target-dir /home/backup -u root -p password
3. Method -> bash/sh -> cp all files ..
Find config files
$ locate my.cnf $ whereis my.cnf $ find / -name my.cnf
$ mysql --help --verbose | grep "my.cnf" or $ mysqld --help --verbose | grep "my.cnf"
Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf $MYSQL_HOME/my.cnf [datadir]/my.cnf ~/.my.cnf
SYSTEMCTL MARIADB
$ systemctl stop mariadb $ systemctl start mariadb $ systemctl restart mariadb
INIT SECURE DB
$ mysql_secure_installation
CREATE NEW USER|GRANT ALL PRIVILEGES
mysql> CREATE USER 'newuser'@'%' IDENTIFIED BY 'password'; mysql> CREATE USER 'newuser'@'[IP|DOMAIN]' IDENTIFIED BY 'password'; mysql> CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost'; mysql> FLUSH PRIVILEGES;