MariaDB: Unterschied zwischen den Versionen

Aus robopagex.com
Zur Navigation springen Zur Suche springen
Zeile 1: Zeile 1:
 
=== EASY BACKUP ===
 
=== EASY BACKUP ===
  [https://mariadb.com/kb/en/mariadb-dumpmysqldump/ mariadb-dump/mysqldump]
+
  '''[https://mariadb.com/kb/en/mariadb-dumpmysqldump/ mariadb-dump/mysqldump]'''
 +
 
 
  1.
 
  1.
 
  $ '''mysqldump -u root -p –all-databases > db.sql'''
 
  $ '''mysqldump -u root -p –all-databases > db.sql'''
Zeile 20: Zeile 21:
  
 
  Default options are read from the following files in the given order:
 
  Default options are read from the following files in the given order:
  /etc/my.cnf
+
  '''/etc/my.cnf'''
  /etc/mysql/my.cnf
+
  '''/etc/mysql/my.cnf'''
  /usr/etc/my.cnf
+
  '''/usr/etc/my.cnf'''
  ~/.my.cnf
+
  '''$MYSQL_HOME/my.cnf'''
 
+
  '''[datadir]/my.cnf'''
etc/my.cnf
+
  '''~/.my.cnf'''
/etc/mysql/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 =====

Version vom 15. Juni 2022, 15:07 Uhr

EASY BACKUP

mariadb-dump/mysqldump
1.
$ mysqldump -u root -p –all-databases > db.sql
$ mysql -u root -p db < db.sql
$ du -sh db.sql
2. 
$ dnf -y install mariadb-backup 
$ mariabackup --backup --target-dir /home/backup -u root -p password 
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;