Hello
I am experimenting with creating new users, granting them privileges and revoking them.
Here is what I am trying to do:
create a new user account for a user with username: 'johnsmith' and password: 'johnpassword'.
Allow that user to right to perform the following commands on database 'dbname': select, update, insert
After reading the manual, here is what I tried:
grant select, update, insert on dbname.* to 'johnsmith' identified by password 'johnpassword';
this didn't work because I got an error saying that:
"Password hash should be a 41-digit hexadecimal number"
could someone show me how I can create a new user account and provide that use with the privileges to select, update, insert?
thanks in advance
how to grants privileges to a user?
Moderator: General Moderators
-
davidklonski
- Forum Contributor
- Posts: 128
- Joined: Mon Mar 22, 2004 4:55 pm
-
davidklonski
- Forum Contributor
- Posts: 128
- Joined: Mon Mar 22, 2004 4:55 pm
-
davidklonski
- Forum Contributor
- Posts: 128
- Joined: Mon Mar 22, 2004 4:55 pm
can you show me the matching revoke command for the same user?
whatever I try, I am getting an error message saying that the SQL statement is invalid
here is correct format, taken from the spec:
REVOKE priv_type [(column_list)] [, priv_type [(column_list)]] ...
ON {tbl_name | * | *.* | db_name.*}
FROM user_name [, user_name] ...
here is what I am trying:
REVOKE select, update, insert ON dbname.* FROM 'johnsmith';
Do I always need to specify the host name as part of the username?
'johnsmith@host'? is 'johnsmith' equivalent to 'johnsmith@localhost' ?
whatever I try, I am getting an error message saying that the SQL statement is invalid
here is correct format, taken from the spec:
REVOKE priv_type [(column_list)] [, priv_type [(column_list)]] ...
ON {tbl_name | * | *.* | db_name.*}
FROM user_name [, user_name] ...
here is what I am trying:
REVOKE select, update, insert ON dbname.* FROM 'johnsmith';
Do I always need to specify the host name as part of the username?
'johnsmith@host'? is 'johnsmith' equivalent to 'johnsmith@localhost' ?