MySQL grant and revoke

mysql -uroot -pRooTIsmE -h mysqlServer

create user special@’%’ identified by ‘password’;
grant all on *.* to special@’%’ identified by ‘password’;
revoke drop, delete on *.* from special@’%’ identified by ‘password’;
flush privileges;
show grants for special@’%’;
exit;

mysql -uspecial -ppassword
create database huypv;
drop database huypv;
#ERROR 1044 (42000): Access denied for user ‘special’@’%’ to database ‘huypv’

3 thoughts on “MySQL grant and revoke

Comments are closed.