MariaDB: Unterschied zwischen den Versionen

Aus robopagex.com
Zur Navigation springen Zur Suche springen
Zeile 10: Zeile 10:
  
 
===== Find config files =====
 
===== Find config files =====
 +
$ '''locate my.cnf'''
 +
$ '''whereis my.cnf'''
 
  $ '''find / -name my.cnf'''
 
  $ '''find / -name my.cnf'''
  $ '''mysqld --help --verbose'''
+
 
 +
$ '''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:
 
  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
 +
 +
etc/my.cnf
 +
/etc/mysql/my.cnf
 +
$MYSQL_HOME/my.cnf
 +
[datadir]/my.cnf
 
  ~/.my.cnf
 
  ~/.my.cnf
  

Version vom 15. Juni 2022, 12:06 Uhr

EASY BACKUP

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
~/.my.cnf
etc/my.cnf
/etc/mysql/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;