But beware: option sql-server mode provides the value of several possible NO_AUTO_CREATE_USER. If this value is active, you can not implicitly create a user without a password with a GRANT statement. In this case, the statement will fail, unless of course you did not already exist. In this example we saw that Grant was not awarded a permit, but if you already have it will still be able to reassign those permissions.
Code:
REVOKE SELECT on purchases .* FROM lucid @ localhost
REVOKE ALL PRIVILEGES, GRANT OPTION FROM Suniert @ localhost
With the first statement we remove the SELECT privilege on the user purchases db lucid @ localhost. In the second we take away all privileges on the tables more than GRANT Suniert @ localhost. In this case the user will no privileges, but its use is still not deleted from the user table. It is important to remember that when you delete a database or table, all existing permits remain active. Obviously this is influential in cases where objects were recreated with the same name. Now let's see some other instructions on the management of permissions:
Code:
Hunter CREATE USER @ localhost;
CREATE USER @ localhost IDENTIFIED BY 'password';
Hunter DROP USER @ localhost;
SET PASSWORD = PASSWORD ('pw');
SET PASSWORD FOR Suniert @ localhost = PASSWORD ('pw');
The first statement creates a user with no password (in this case it works even if NO_AUTO_CREATE_USER is active), the second creates a user password. Those users must already exist. The third statement removes a user. The fourth set the password 'pw' for the user logged on, the last set the password 'pw' user @ localhost Suniert.
Bookmarks