user image

Mohamed Atef
Published in : 2022-04-01

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

PHP & Mysql

When I try to Grant Privileges to user called mo-atef I get this error 

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

I started Mysql using this command 

mysql -u root -p

so How I don't have permission to do it?
I created the user using 

CREATE USER 'mo-atef'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

Any idea about it?

 

Comments

Jo Micheal Date : 2022-04-01

Best answers

5

Best answers

5

It's weird, this should be working because you used the root user, can you please run this command to make sure that the user is created successfully?

USE mysql; 

then get the users table using 

SELECT user FROM user;

take a look at the table and see if your user exists or no, If no please create it like this 

CREATE USER 'mo-atef'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

then you can Grant the privileges using this command 

GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT, REFERENCES, RELOAD on *.* TO 'mo-atef'@'localhost' WITH GRANT OPTION;

Good luck

Mohamed Atef Date : 2022-04-01

Oh thank you so much I missed it the user didn't created with my command at the first, Thank you so much

Leave a comment

Join us

Join our community and get the chance to solve your code issues & share your opinion with us

Sign up Now

Related posts

PHP mail function goes to spam not inbox
Publish date: 2022-02-28 | Comments: 2

Tag: PHP & Mysql

MySQL - Lost connection to MySQL server during query - Required a solution.
Publish date: 2022-03-03 | Comments: 1

Tag: PHP & Mysql

[solved] Storage engine 'InnoDB' does not support system tables
Publish date: 2022-01-09 | Comments: 0

Tag: PHP & Mysql

[solved] #1273 - Unknown collation: 'utf8mb4_0900_ai_ci'
Publish date: 2022-01-09 | Comments: 1

Tag: PHP & Mysql

change user root privelige and password
Publish date: 2022-02-23 | Comments: 1

Tag: PHP & Mysql

How the image file have .php extension?
Publish date: 2022-03-01 | Comments: 2

Tag: PHP & Mysql

Mysql query: How do I count the day streak of particular user?
Publish date: 2022-03-01 | Comments: 4

Tag: PHP & Mysql

php difference between two times in hours
Publish date: 2022-02-25 | Comments: 2

Tag: PHP & Mysql