Outdated Version

You are viewing an older version of this section. View current production version.

GRANT

Create a user account with the specified privileges.

GRANT priv_type [, priv_type] ... ON priv_level
    TO user_specification [, user_specification] ...
    WITH GRANT OPTION
    [REQUIRE {SSL | NONE}]

user_specification:
    user
    [
        IDENTIFIED BY [PASSWORD] 'password'
    ]

priv_level:
    *
  | *.*
  | database.*

priv_type:
	  SELECT
	| INSERT
	| UPDATE
	| DELETE
	| CREATE
	| DROP
	| RELOAD
	| PROCESS
	| FILE READ
	| FILE WRITE
	| GRANT OPTION
	| INDEX
	| ALTER
	| SHOW METADATA
	| SUPER
	| CREATE TEMPORARY TABLES
	| LOCK TABLES
	| REPLICATION
	| CREATE VIEW
	| SHOW VIEW
	| CREATE USER
	| CLUSTER
	| ALTER VIEW
	| DROP VIEW
	| BACKUP
	| CREATE DATABASE
	| DROP DATABASE

Notes

  • user_specification - user specification
  • priv_level - privilege level
  • priv_type - privilege type
  • This command can be run on any MemSQL node
Info

MemSQL Community Edition only allows the creation of new users with root permissions.

Example

memsql> GRANT ALL ON *.* TO 'memsql_admin'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

memsql> GRANT BACKUP, RELOAD ON *.* TO 'full_backups_role';