MariaDB - Ein paar Befehle
-
Einloggen
mysql -u root -p
User anzeigen
MariaDB [(none)]> SELECT User,Host FROM mysql.user; +--------------+----- --------+ | User | Host | +--------------+---- ---------+ | frank | 192.10.0.167 | | root | localhost | +--------------+--------------+ 2 rows in set (0.000 sec)
User anlegen
Alle User anzeigen
select Host, User from mysql.user;
Zugriff von Extern
CREATE USER 'frank'@'192.10.0.167' IDENTIFIED BY 'password';
Zugriff von Lokal
CREATE USER 'frank'@'localhost' IDENTIFIED BY 'password';
User löschen
DROP USER 'frank'@'192.10.0.167';
Datenbank anlegen
CREATE DATABASE joomla;
Datenbanken anzeigen
MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | DB1 | | DB2 | | information_schema | | joomla | | mysql | | performance_schema | +--------------------+ 6 rows in set (0.000 sec)
Datenbank löschen
DROP DATABASE bufg;
Privilegien zuweisen!
grant all privileges on joomla.* to user@localhost identified by 'password';
FLUSH PRIVILEGES
FLUSH PRIVILEGES;