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

6

Best answers

6

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

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

Tag: PHP & Mysql

Warning appears in Zend framework
Publish date: 2022-02-24 | Comments: 1

Tag: PHP & Mysql

(Mysql) Count User's signing in activity based on daily login logs
Publish date: 2022-11-05 | Comments: 0

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

mysql service start not exist
Publish date: 2022-02-23 | Comments: 4

Tag: PHP & Mysql

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

Tag: PHP & Mysql

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

Tag: PHP & Mysql

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

Tag: PHP & Mysql