Suggest an editImprove this articleRefine the answer for “How do you create a user?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)A user is created with the `CREATE USER` command: the general syntax is `CREATE USER username WITH PASSWORD 'password'`, after which you can grant them access rights via `GRANT`. **Key point:** the syntax varies slightly by DBMS - PostgreSQL uses `CREATE USER` or `CREATE ROLE`, while MySQL uses `CREATE USER 'name'@'localhost' IDENTIFIED BY 'password'`.Shown above the full answer for quick recall.Answer (EN)ImageA user is created with the `CREATE USER` command. General syntax: ```sql CREATE USER username WITH PASSWORD 'password'; ``` ### Example ```sql CREATE USER analyst WITH PASSWORD 'secure123'; ``` Once created, you can grant them access rights: ```sql GRANT CONNECT ON DATABASE company TO analyst; GRANT SELECT, INSERT ON TABLE employees TO analyst; ``` The syntax varies slightly by DBMS: - In **PostgreSQL**, you use `CREATE USER` or `CREATE ROLE`; - In **MySQL**, it looks like this: ```sql CREATE USER 'analyst'@'localhost' IDENTIFIED BY 'secure123'; ``` **Summary:** the `CREATE USER` command creates the account, and `GRANT` sets its **permissions and access to database objects**.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.