Skip to main content

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 dropping 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 <databaseName> CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
  • Create a new user and grant privileges
    •  CREATE USER <username>@localhost IDENTIFIED BY '<password>';
    • GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON <dbName>.*
      TO '<userName>'@'localhost' IDENTIFIED BY '<password>';
    • FLUSH PRIVILEGES