MySQL CREATE USER & GRANT Generator
Build a complete MySQL 8.0 / 8.4 account script in seconds: CREATE USER with the right authentication plugin, SSL and password policies, then GRANT statements scoped to *.*, a database or specific tables — including column-level privileges and optional roles. Global-only privileges such as PROCESS or REPLICATION CLIENT are automatically split into their own GRANT ON *.*, and a REVOKE / DROP USER rollback script and SHOW GRANTS check are generated alongside. Everything runs in your browser — nothing is sent to a server.
Do more than mysql create user & grant generator — meet Chat2DB
Chat2DB is an AI-powered SQL client for Windows, macOS and Linux. Write SQL in natural language, format and optimize queries automatically, and manage MySQL, PostgreSQL, Oracle and 20+ other databases in one workspace.
How to use
- Enter the user name and host pattern (%, localhost, an IP or a subnet like 10.0.%), set a password, authentication plugin and optional SSL, password-expiry or lockout rules.
- Choose the scope (global, database or specific tables) and a preset — read-only, read-write, app owner, replication, mysqldump backup, ALL — or tick individual privileges; optionally add column privileges, a role or WITH GRANT OPTION.
- Copy the script and run it as root or an admin account, confirm with SHOW GRANTS, and keep the REVOKE / DROP USER script to roll back.
Frequently asked questions
Why do I get “You are not allowed to create a user with GRANT” in MySQL 8?
Since MySQL 8.0, GRANT no longer creates accounts implicitly and no longer accepts IDENTIFIED BY. You must run CREATE USER 'name'@'host' IDENTIFIED BY 'password' first and then GRANT ... TO 'name'@'host'. The account is identified by both user name and host, so 'app'@'%' and 'app'@'localhost' are two different accounts — grant to the exact pair you created. This generator always emits CREATE USER before GRANT.
Which privileges does a mysqldump backup user need?
For a consistent dump of InnoDB tables with --single-transaction, grant SELECT, SHOW VIEW, TRIGGER, LOCK TABLES and EVENT on the databases you dump, plus PROCESS on *.* (needed to dump tablespace information since MySQL 8.0.21, or use --no-tablespaces). PROCESS is a global privilege, so it must be granted ON *.* in a separate statement — the tool does this automatically. Add RELOAD on *.* if you use --flush-logs or --source-data.
Do I need FLUSH PRIVILEGES after GRANT or CREATE USER?
No. CREATE USER, GRANT, REVOKE, ALTER USER and DROP USER update the in-memory grant tables immediately. FLUSH PRIVILEGES is only needed if you modify the mysql.* grant tables directly with INSERT/UPDATE, which you should avoid. To check the result run SHOW GRANTS FOR 'user'@'host'. If you prefer a GUI, Chat2DB — a free AI-powered database client — lets you manage MySQL users and run these checks visually; download it at https://chat2db.ai/download or use the web version at https://app.chat2db.ai.
