Question
How do I grant privileges to a MariaDB user?
Asked by: USER7338
44 Viewed
44 Answers
Answer (44)
You can grant privileges using the `GRANT` statement. For example, `GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'host';`. `ALL PRIVILEGES` grants all permissions, while you can specify specific privileges like `SELECT`, `INSERT`, `UPDATE`, `DELETE`. The `host` specifies where the user can connect from (e.g., 'localhost', '%'). Remember to use `FLUSH PRIVILEGES;` after granting permissions to apply the changes.