github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/mysql/r/grant.html.markdown (about) 1 --- 2 layout: "mysql" 3 page_title: "MySQL: mysql_grant" 4 sidebar_current: "docs-mysql-resource-grant" 5 description: |- 6 Creates and manages privileges given to a user on a MySQL server 7 --- 8 9 # mysql\_grant 10 11 The ``mysql_grant`` resource creates and manages privileges given to 12 a user on a MySQL server. 13 14 ## Example Usage 15 16 ```hcl 17 resource "mysql_user" "jdoe" { 18 user = "jdoe" 19 host = "example.com" 20 password = "password" 21 } 22 23 resource "mysql_grant" "jdoe" { 24 user = "${mysql_user.jdoe.user}" 25 host = "${mysql_user.jdoe.host}" 26 database = "app" 27 privileges = ["SELECT", "UPDATE"] 28 } 29 ``` 30 31 ## Argument Reference 32 33 The following arguments are supported: 34 35 * `user` - (Required) The name of the user. 36 37 * `host` - (Optional) The source host of the user. Defaults to "localhost". 38 39 * `database` - (Required) The database to grant privileges on. At this time, 40 privileges are given to all tables on the database (`mydb.*`). 41 42 * `privileges` - (Required) A list of privileges to grant to the user. Refer 43 to a list of privileges (such as 44 [here](https://dev.mysql.com/doc/refman/5.5/en/grant.html)) for applicable 45 privileges. 46 47 * `grant` - (Optional) Whether to also give the user privileges to grant 48 the same privileges to other users. 49 50 ## Attributes Reference 51 52 No further attributes are exported.