Syntax - Create User
CREATE USER 'username'@'host' IDENTIFIED WITH authentication_plugin BY 'password'; Beispiel: CREATE USER 'sammy'@'localhost' IDENTIFIED BY 'password';
Syntax Grant
GRANT PRIVILEGE ON DATABASE.table TO 'username'@'host'; FLUSH PRIVILEGES; Beispiel: GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT, REFERENCES, RELOAD ON *.* TO 'sammy'@'localhost' WITH GRANT OPTION; SHOW GRANTS FOR 'username'@'host';
Sonstiges
REVOKE type_of_permission ON database_name.table_name FROM 'username'@'host'; DROP USER 'username'@'localhost';