Examples for business, study, careers, love, and more...
Examples :: MYSQL Examples :: Example of Grant Mysql statement

Example of GrantMysql Statement:

GRANT ALL ON *.* and REVOKE ALL ON *.*;
GRANT ALL ON *.* TO jack;
GRANT SELECT, INSERT, DELETE ON db_base.* TO db_user@'localhost' IDENTIFIED BY 'db_passwd';
GRANT SELECT ON db_base.* TO db_user@'localhost' IDENTIFIED BY 'db_passwd';
GRANT ALL PRIVILEGES ON db_base.phonebook TO db_user @'%' IDENTIFIED BY 'db_passwd';

Example of Mysql Grant


GRANT
priv_type [(column_list)]
[, priv_type [(column_list)]] ...
ON [object_type] priv_level
TO user [IDENTIFIED BY [PASSWORD] 'password']
[, user [IDENTIFIED BY [PASSWORD] 'password']] ...
[REQUIRE {NONE | ssl_option [[AND] ssl_option] ...}]
[WITH with_option [with_option] ...]

object_type:
TABLE
| FUNCTION
| PROCEDURE

priv_level:
*
| *.*
| db_name.*
| db_name.tbl_name
| tbl_name
| db_name.routine_name

with_option:
GRANT OPTION
| MAX_QUERIES_PER_HOUR count
| MAX_UPDATES_PER_HOUR count
| MAX_CONNECTIONS_PER_HOUR count
| MAX_USER_CONNECTIONS count

ssl_option:
SSL
| X509
| CIPHER 'cipher'
| ISSUER 'issuer'
| SUBJECT 'subject'