Share via


az mysql db

Manage MySQL databases on a server.

Commands

Name Description Type Status
az mysql db create

Create a MySQL database.

Core GA
az mysql db delete

Delete a database.

Core GA
az mysql db list

List the databases for a server.

Core GA
az mysql db show

Show the details of a database.

Core GA

az mysql db create

Create a MySQL database.

az mysql db create --name
                   --resource-group
                   --server-name
                   [--charset]
                   [--collation]

Examples

Create database 'testdb' in the server 'testsvr' with the default parameters.

az mysql db create -g testgroup -s testsvr -n testdb

Create database 'testdb' in server 'testsvr' with a given character set and collation rules.

az mysql db create -g testgroup -s testsvr -n testdb --charset {valid_charset} --collation {valid_collation}

Required Parameters

--name -n

The name of the database.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--server-name -s

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

Optional Parameters

--charset

The charset of the database.

--collation

The collation of the database.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az mysql db delete

Delete a database.

az mysql db delete --name
                   [--ids]
                   [--resource-group]
                   [--server-name]
                   [--subscription]
                   [--yes]

Examples

Delete database 'testdb' in the server 'testsvr'.

az mysql db delete -g testgroup -s testsvr -n testdb

Required Parameters

--name -n

The name of the database.

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--server-name -s

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--yes -y

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az mysql db list

List the databases for a server.

az mysql db list --resource-group
                 --server-name

Examples

List databases in the server 'testsvr'.

az mysql db list -g testgroup -s testsvr

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--server-name -s

Name of the Server.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az mysql db show

Show the details of a database.

az mysql db show --name
                 [--ids]
                 [--resource-group]
                 [--server-name]
                 [--subscription]

Examples

Show database 'testdb' in the server 'testsvr'.

az mysql db show -g testgroup -s testsvr -n testdb

Required Parameters

--name -n

The name of the database.

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--server-name -s

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.