Kategorien
Befehle Mysql,MariaDB

MySQL und MariaDB: User anlegen und Rechte zuweisen

User anlegen und Rechte zuweisen

mysql -u root -p
select * from mysql;
CREATE USER 'newUser'@'localhost' IDENTIFIED BY 'securePassword';
CREATE DATABASE  newDatabase;
GRANT ALL PRIVILEGES ON newDatabase. * TO 'newUser'@'localhost';
FLUSH PRIVILEGES;

User mit Root-Rechten

CREATE USER 'admin'@'localhost' identified by 'securepassword!!!';

GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' with grant option;

FLUSH PRIVILEGES;

exit

service mysql restart