MySQL 8.4Lab-verified · 2026-11-30

MySQL ERROR 1410 (42000): You are not allowed to create a user with GRANT

GRANT named an account (user@host) that does not exist; MySQL 8 no longer creates it for you.

MySQL 8.4.13
1410 (42000): You are not allowed to create a user with GRANT

Jump to a cause

  1. 01The user was never created
  2. 02The user exists, but with a different host

Lab-verifiedReproduced and fixed on MySQL 8.4.13 · 2026-11-30 · container image mysql:8.4

In MySQL 8.0 and later, GRANT only gives privileges to an existing account. Old tutorials that create a user with GRANT fail with ERROR 1410. An account is the pair 'user'@'host', so 'app_user'@'localhost' and 'app_user'@'%' are different accounts.

Below are two cases reproduced on MySQL 8.4 with the fixes that were actually run. MySQL returns this message in English even with Korean or Japanese lc_messages.

01The user was never created

GRANT SELECT, INSERT ON shop.* TO 'app_user'@'%' failed with ERROR 1410 because app_user did not exist.

After CREATE USER 'app_user'@'%' IDENTIFIED BY '...', the same GRANT succeeded and SHOW GRANTS listed GRANT SELECT, INSERT ON shop.* TO app_user@%.

Setup
Setuprun as root
CREATE DATABASE shop;
OUTPUT
Query OK, 1 row affected (0.00 sec)
Reproducerun as root
GRANT SELECT, INSERT ON shop.* TO 'app_user'@'%';
✕ ERROR
ERROR 1410 (42000): You are not allowed to create a user with GRANT
Fixrun as root
CREATE USER 'app_user'@'%' IDENTIFIED BY 'App#Pass2026';
OUTPUT
Query OK, 0 rows affected (0.01 sec)
After the fixrun as root
GRANT SELECT, INSERT ON shop.* TO 'app_user'@'%';
SHOW GRANTS FOR 'app_user'@'%';
✓ SUCCESS
Query OK, 0 rows affected (0.01 sec)

+----------------------------------------------------+
| Grants for app_user@%                              |
+----------------------------------------------------+
| GRANT USAGE ON *.* TO `app_user`@`%`               |
| GRANT SELECT, INSERT ON `shop`.* TO `app_user`@`%` |
+----------------------------------------------------+
2 rows in set (0.00 sec)

02The user exists, but with a different host

Only 'app_user'@'localhost' existed. GRANT SELECT ON shop.* TO 'app_user'@'%' failed with ERROR 1410, because app_user@% is a different account. SELECT user, host FROM mysql.user showed only the localhost row.

After CREATE USER 'app_user'@'%', the GRANT succeeded; mysql.user then had two rows (% and localhost).

Setup
Setuprun as root
CREATE DATABASE shop;
CREATE USER 'app_user'@'localhost' IDENTIFIED BY 'App#Pass2026';
OUTPUT
Query OK, 1 row affected (0.00 sec)

Query OK, 0 rows affected (0.01 sec)
Reproducerun as root
GRANT SELECT ON shop.* TO 'app_user'@'%';
✕ ERROR
ERROR 1410 (42000): You are not allowed to create a user with GRANT
Checkrun as root
SELECT user, host FROM mysql.user WHERE user = 'app_user';
OUTPUT
+----------+-----------+
| user     | host      |
+----------+-----------+
| app_user | localhost |
+----------+-----------+
1 row in set (0.00 sec)
Fixrun as root
CREATE USER 'app_user'@'%' IDENTIFIED BY 'App#Pass2026';
OUTPUT
Query OK, 0 rows affected (0.01 sec)

Grant to the host your application actually connects from. If the localhost account was a mistake, you can grant to it instead, but it only matches local connections.

After the fixrun as root
GRANT SELECT ON shop.* TO 'app_user'@'%';
SHOW GRANTS FOR 'app_user'@'%';
SELECT user, host FROM mysql.user WHERE user = 'app_user' ORDER BY host;
✓ SUCCESS
Query OK, 0 rows affected (0.00 sec)

+--------------------------------------------+
| Grants for app_user@%                      |
+--------------------------------------------+
| GRANT USAGE ON *.* TO `app_user`@`%`       |
| GRANT SELECT ON `shop`.* TO `app_user`@`%` |
+--------------------------------------------+
2 rows in set (0.00 sec)

+----------+-----------+
| user     | host      |
+----------+-----------+
| app_user | %         |
| app_user | localhost |
+----------+-----------+
2 rows in set (0.00 sec)

FAQ

Why does GRANT not create the user in MySQL 8?

MySQL 8.0 removed implicit user creation by GRANT. Create the account with CREATE USER, then GRANT.

The user exists, why do I still get ERROR 1410?

Check the host part. SELECT user, host FROM mysql.user WHERE user = '...' shows which user@host pairs exist. GRANT must name one of them exactly.

Can I use GRANT ... IDENTIFIED BY in MySQL 8?

No. Put the password in CREATE USER (or ALTER USER) and use GRANT only for privileges.

How we verify

Each scenario starts from fresh database users. A script runs the setup, confirms the exact error code, applies the fix and runs the statement again. The output shown is what the database printed, saved by the script.

lab_a and lab_b are ordinary users created for the test, each with full rights on a database of the same name (its default database); root is the administrator. MySQL 8.4.13