When trying to assign permissions to a non-existent user in MySQL8, it responds with a somewhat ambiguous and meaningless error. In this article, we will see that creating the user before assigning the grants solves the problem.
The error in question is as follows:
GRANT ALL ON test.* TO test_user@'%';
ERROR 1410 (42000): You are not allowed to create a user with GRANT
We create the user and verify that it allows assigning the permissions without any problem:
CREATE USER test_user@'%' IDENTIFIED BY 'PASSWORD';
GRANT ALL ON test.* TO test_user@'%';