![]() ![]() I think may have figured out the root of your problem. You can also do it this way (a more elegant solution perhaps) GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP,įinally, you could just remove the CREATE USER privilege (and, of course, the WITH GRANT OPTION) from this answer to have a "super user" who can do everything except create new users. Always test your users after creation - it's very easy to give users too much power. TO bivv-acclocalhost Check the manual which says: If an identifier contains special characters or is a reserved word, you must quote it whenever you refer to it. Take a look at the three answers here, here and here for a better idea of what's going on. Mysql> insert into test values(3, 'testvalue') mysql> create table test (a int, b varchar(10)) mysql> create user IDENTIFIED BY 'mary' ĮRROR 1227 (42000): Access denied you need (at least one of) the CREATE USER privilege(s) for this operationīut, I can do this. There are many more schemas on this server - it's just that myuser can't see them. Show all the schemas myuser can see mysql> show schemas ![]() Server version: 5.6.22-log Source distribution Then, on the sport schema, grant ALL to myuser mysql> GRANT ALL ON sport.* TO OK, 0 rows affected (0.02 sec)Įxit and then log on as the new user myuser mysql> inst]$. Grant all privileges on *.* to create user on *.* from privileges Īfter this i logged out of the root account and signed in with the 'user91' account and tried to create another user with this code: create user identified by 'stealth' Īnd this code worked, what should i add in the first block of code in order to prevent 'user91' from creating other users.Īs root: mysql> CREATE USER IDENTIFIED BY 'billy' These are the codes that i used in my root account to create a new user and give him privileges except for the 'create user' privilege: create user identified by 'google' i thought this is would be enough but when i logged in with the new user, i was able to create another user. then i gave him all the privileges, then i revoked the 'create user' privilege from this new user, then i 'flushed privileges'. I tried to create a user through the root account. Moreover, this is a question that comes up regularly in the forums, on Slack or on StackOverflow. My task is simple i want to create a user in MySQL server that has all the privileges but excluding the ability to create other users. By granting the appropriate privileges to each user, you can ensure that your database remains secure while still allowing users to perform the tasks that they need to. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |