github.com/pmcatominey/terraform@v0.7.0-rc2.0.20160708105029-1401a52a5cc5/website/source/docs/providers/mysql/r/database.html.markdown (about) 1 --- 2 layout: "mysql" 3 page_title: "MySQL: mysql_database" 4 sidebar_current: "docs-mysql-resource-database" 5 description: |- 6 Creates and manages a database on a MySQL server. 7 --- 8 9 # mysql\_database 10 11 The ``mysql_database`` resource creates and manages a database on a MySQL 12 server. 13 14 ~> **Caution:** The ``mysql_database`` resource can completely delete your 15 database just as easily as it can create it. To avoid costly accidents, 16 consider setting 17 [``prevent_destroy``](/docs/configuration/resources.html#prevent_destroy) 18 on your database resources as an extra safety measure. 19 20 ## Example Usage 21 22 ``` 23 resource "mysql_database" "app" { 24 name = "my_awesome_app" 25 } 26 ``` 27 28 ## Argument Reference 29 30 The following arguments are supported: 31 32 * `name` - (Required) The name of the database. This must be unique within 33 a given MySQL server and may or may not be case-sensitive depending on 34 the operating system on which the MySQL server is running. 35 36 * `default_character_set` - (Optional) The default character set to use when 37 a table is created without specifying an explicit character set. Defaults 38 to "utf8". 39 40 * `default_collation` - (Optional) The default collation to use when a table 41 is created without specifying an explicit collation. Defaults to 42 ``utf8_general_ci``. Each character set has its own set of collations, so 43 changing the character set requires also changing the collation. 44 45 Note that the defaults for character set and collation above do not respect 46 any defaults set on the MySQL server, so that the configuration can be set 47 appropriately even though Terraform cannot see the server-level defaults. If 48 you wish to use the server's defaults you must consult the server's 49 configuration and then set the ``default_character_set`` and 50 ``default_collation`` to match. 51 52 ## Attributes Reference 53 54 No further attributes are exported.