Skip to content
This repository has been archived by the owner on Oct 9, 2018. It is now read-only.

Latest commit

 

History

History
82 lines (64 loc) · 1.19 KB

File metadata and controls

82 lines (64 loc) · 1.19 KB

Grant

  • Admin

    • FILE
    • PROCESS
    • SUPER
    • ALL
  • Table

    • SELECT
    • DELETE
    • INSERT
    • UPDATE
-- dba
create user 'dba'@'localhost' identified by 'password';
grant all on *.* to 'dba'@'localhost';
flush privileges;

-- repl
create user 'repl'@'%' identified by 'password';
grant replication slave on *.* to 'repl'@'%';
flush privileges;
GRANT SELECT ON sakila.* TO
'shawn'@'localhost' IDENTIFIED BY 'passwd';
SHOW GRANTS ;
FLUSH PRIVILEGES ;

mysqladmin

mysqladmin flush-privileges
mysqladmin reload

REVOKE

REVOKE DELETE, INSERT, UPDATE ON sakila.*
FROM 'shawn'@'localhost';
mysqld_safe --skip-grant-tables

mysql --skip-networking
mysql --socket

Account Resource Limits

  • MAX_USER_CONNECTIONS
  • MAX_QUERIES_PER_HOUR
  • MAX_UPDATES_PER_HOUR
  • MAX_CONNECTIONS_PER_HOUR
  • MAX_USER_CONNECTIONS
GRANT ALL ON sakila.* TO 'shawn'@'localhost'
WITH MAX_QUERIES_PER_HOUR 20
MAX_UPDATES_PER_HOUR 10
MAX_CONNECTIONS_PER_HOUR 5
MAX_USER_CONNECTIONS 2;
SHOW GRANTS FOR 'shawn'@'localhost';

REF