user

Mohamed Atef

1 Apr 2022

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

1 Apr 2022

Best Answer

best answer

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

Replies

Mohamed Atef

1 Apr 2022

githubgithubgithub

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

© 2024 Copyrights reserved for web-brackets.com