# Drop user

##### Drop, Delete, Remove a MariaDb user

- IMPORTANT NOTES 
    - Do not *delete* a user from the *mysql.user* table, but use the *drop* command
    - After *drop*ping a user, it appears you need to use *flush privileges* before recreating the user
- Drop a user 
    - DROP USER 'user1'@localhost;
    - FLUSH PRIVILEGES;
- Create a new database 
    - CREATE DATABASE &lt;databaseName&gt; CHARACTER SET utf8mb4 COLLATE utf8mb4\_unicode\_ci;
- Create a new user and grant privileges 
    - CREATE USER &lt;username&gt;@localhost IDENTIFIED BY '&lt;password&gt;';
    - GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON &lt;dbName&gt;.\*  
        TO '&lt;userName&gt;'@'localhost' IDENTIFIED BY '&lt;password&gt;';
    - FLUSH PRIVILEGES