gcloud sql instances create
INSTANCE
[--activation-policy
=ACTIVATION_POLICY
] [--active-directory-domain
=ACTIVE_DIRECTORY_DOMAIN
] [--[no-]assign-ip
] [--async
] [--audit-bucket-path
=AUDIT_BUCKET_PATH
] [--audit-retention-interval
=AUDIT_RETENTION_INTERVAL
] [--audit-upload-interval
=AUDIT_UPLOAD_INTERVAL
] [--authorized-networks
=NETWORK
,[NETWORK
,…]] [--availability-type
=AVAILABILITY_TYPE
] [--no-backup
] [--backup-location
=BACKUP_LOCATION
] [--backup-start-time
=BACKUP_START_TIME
] [--cascadable-replica
] [--collation
=COLLATION
] [--connector-enforcement
=CONNECTOR_ENFORCEMENT
] [--cpu
=CPU
] [--custom-subject-alternative-names
=DNS
,[DNS
,[DNS
]]] [--database-flags
=FLAG
=VALUE
,[FLAG
=VALUE
,…]] [--database-version
=DATABASE_VERSION
; default="MYSQL_8_0"
] [--[no-]deletion-protection
] [--deny-maintenance-period-end-date
=DENY_MAINTENANCE_PERIOD_END_DATE
] [--deny-maintenance-period-start-date
=DENY_MAINTENANCE_PERIOD_START_DATE
] [--deny-maintenance-period-time
=DENY_MAINTENANCE_PERIOD_TIME
] [--edition
=EDITION
] [--enable-bin-log
] [--[no-]enable-data-cache
] [--[no-]enable-dataplex-integration
] [--[no-]enable-google-ml-integration
] [--enable-google-private-path
] [--enable-password-policy
] [--enable-point-in-time-recovery
] [--failover-replica-name
=FAILOVER_REPLICA_NAME
] [--[no-]insights-config-query-insights-enabled
] [--insights-config-query-plans-per-minute
=INSIGHTS_CONFIG_QUERY_PLANS_PER_MINUTE
] [--insights-config-query-string-length
=INSIGHTS_CONFIG_QUERY_STRING_LENGTH
] [--[no-]insights-config-record-application-tags
] [--[no-]insights-config-record-client-address
] [--instance-type
=INSTANCE_TYPE
] [--maintenance-release-channel
=MAINTENANCE_RELEASE_CHANNEL
] [--maintenance-window-day
=MAINTENANCE_WINDOW_DAY
] [--maintenance-window-hour
=MAINTENANCE_WINDOW_HOUR
] [--master-instance-name
=MASTER_INSTANCE_NAME
] [--memory
=MEMORY
] [--network
=NETWORK
] [--node-count
=NODE_COUNT
] [--password-policy-complexity
=PASSWORD_POLICY_COMPLEXITY
] [--[no-]password-policy-disallow-username-substring
] [--password-policy-min-length
=PASSWORD_POLICY_MIN_LENGTH
] [--password-policy-password-change-interval
=PASSWORD_POLICY_PASSWORD_CHANGE_INTERVAL
] [--password-policy-reuse-interval
=PASSWORD_POLICY_REUSE_INTERVAL
] [--psc-auto-connections
=[network
=NETWORK
],[project
=PROJECT
]] [--[no-]recreate-replicas-on-primary-crash
] [--replica-type
=REPLICA_TYPE
] [--replication
=REPLICATION
] [--require-ssl
] [--[no-]retain-backups-on-delete
] [--retained-backups-count
=RETAINED_BACKUPS_COUNT
] [--retained-transaction-log-days
=RETAINED_TRANSACTION_LOG_DAYS
] [--root-password
=ROOT_PASSWORD
] [--server-ca-mode
=SERVER_CA_MODE
] [--server-ca-pool
=SERVER_CA_POOL
] [--ssl-mode
=SSL_MODE
] [--[no-]storage-auto-increase
] [--storage-provisioned-iops
=STORAGE_PROVISIONED_IOPS
] [--storage-provisioned-throughput
=STORAGE_PROVISIONED_THROUGHPUT
] [--storage-size
=STORAGE_SIZE
] [--storage-type
=STORAGE_TYPE
] [--tags
=TAG
=VALUE
,[TAG
=VALUE
,…]] [--threads-per-core
=THREADS_PER_CORE
] [--tier
=TIER
, -t
TIER
] [--time-zone
=TIME_ZONE
] [--timeout
=TIMEOUT
; default=3600] [--allowed-psc-projects
=PROJECT
,[PROJECT
,…] --enable-private-service-connect
] [--disk-encryption-key
=DISK_ENCRYPTION_KEY
: --disk-encryption-key-keyring
=DISK_ENCRYPTION_KEY_KEYRING
--disk-encryption-key-location
=DISK_ENCRYPTION_KEY_LOCATION
--disk-encryption-key-project
=DISK_ENCRYPTION_KEY_PROJECT
] [--region
=REGION
; default="us-central" | --gce-zone
=GCE_ZONE
| --secondary-zone
=SECONDARY_ZONE
--zone
=ZONE
] [GCLOUD_WIDE_FLAG …
]
prod-instance
that has 2 CPUs, 4 GB of RAM, and is in the region us-central1
(a zone will be auto-assigned), where the 'root' user has its password set to password123
, run:
gcloud sql instances create prod-instance --database-version=MYSQL_8_0 --cpu=2 --memory=4GB --region=us-central1 --root-password=password123
To create a Postgres 15 instance with ID
that has 2 CPUs, 8 GiB of RAM, and is in the zone prod-instance
, where the 'postgres' user has its password set to us-central1-a
, run:password123
gcloud sql instances create prod-instance --database-version=POSTGRES_15 --cpu=2 --memory=8GiB --zone=us-central1-a --root-password=password123
To create a SQL Server 2022 Express instance with ID
that has 2 CPUs, 3840MiB of RAM, and is in the zone prod-instance
, where the 'sqlserver' user has its password set to us-central1-a
, run:password123
gcloud sql instances create prod-instance --database-version=SQLSERVER_2022_EXPRESS --cpu=2 --memory=3840MiB --zone=us-central1-a --root-password=password123
INSTANCE
--activation-policy
=ACTIVATION_POLICY
RUNNABLE
. The default is always
. More information on activation policies can be found here: https://cloud.google.com/sql/docs/mysql/start-stop-restart-instance#activation_policy. ACTIVATION_POLICY
must be one of: always
, never
.
--active-directory-domain
=ACTIVE_DIRECTORY_DOMAIN
--[no-]assign-ip
--assign-ip
to enable and --no-assign-ip
to disable.
--async
--audit-bucket-path
=AUDIT_BUCKET_PATH
--audit-retention-interval
=AUDIT_RETENTION_INTERVAL
--audit-upload-interval
=AUDIT_UPLOAD_INTERVAL
--availability-type
=AVAILABILITY_TYPE
AVAILABILITY_TYPE
must be one of:
regional
zonal
--backup
--no-backup
to disable.
--backup-location
=BACKUP_LOCATION
--backup-start-time
=BACKUP_START_TIME
--cascadable-replica
--master-instance-name
flag is set, and the replica under creation is in a different region than the primary instance.
--collation
=COLLATION
--connector-enforcement
=CONNECTOR_ENFORCEMENT
CONNECTOR_ENFORCEMENT
must be one of:
CONNECTOR_ENFORCEMENT_UNSPECIFIED
NOT_REQUIRED
REQUIRED
--cpu
=CPU
--custom-subject-alternative-names
=DNS
,[DNS
,[DNS
]]
--database-flags
=FLAG
=VALUE
,[FLAG
=VALUE
,…]
skip_grant_tables=
. Use on/off for booleans. View the Instance Resource API for allowed flags. (e.g., --database-flags max_allowed_packet=55555,skip_grant_tables=,log_output=1
)
--database-version
=DATABASE_VERSION
; default="MYSQL_8_0"
DATABASE_VERSION
must be one of: MYSQL_5_6
, MYSQL_5_7
, MYSQL_8_0
, MYSQL_8_4
, POSTGRES_9_6
, POSTGRES_10
, POSTGRES_11
, POSTGRES_12
, POSTGRES_13
, POSTGRES_14
, POSTGRES_15
, POSTGRES_16
, POSTGRES_17
, SQLSERVER_2017_EXPRESS
, SQLSERVER_2017_WEB
, SQLSERVER_2017_STANDARD
, SQLSERVER_2017_ENTERPRISE
, SQLSERVER_2019_EXPRESS
, SQLSERVER_2019_WEB
, SQLSERVER_2019_STANDARD
, SQLSERVER_2019_ENTERPRISE
, SQLSERVER_2022_EXPRESS
, SQLSERVER_2022_WEB
, SQLSERVER_2022_STANDARD
, SQLSERVER_2022_ENTERPRISE
.
--[no-]deletion-protection
--deletion-protection
to enable and --no-deletion-protection
to disable.
--deny-maintenance-period-end-date
=DENY_MAINTENANCE_PERIOD_END_DATE
2021-01-10
.
--deny-maintenance-period-start-date
=DENY_MAINTENANCE_PERIOD_START_DATE
2020-11-01
.
--deny-maintenance-period-time
=DENY_MAINTENANCE_PERIOD_TIME
05:00:00
.
--edition
=EDITION
EDITION
must be one of: enterprise
, enterprise-plus
.
--enable-bin-log
--[no-]enable-data-cache
--enable-data-cache
to enable and --no-enable-data-cache
to disable.
--[no-]enable-dataplex-integration
--enable-dataplex-integration
to enable and --no-enable-dataplex-integration
to disable.
--[no-]enable-google-ml-integration
--enable-google-ml-integration
to enable and --no-enable-google-ml-integration
to disable.
--enable-google-private-path
--enable-password-policy
--enable-point-in-time-recovery
--failover-replica-name
=FAILOVER_REPLICA_NAME
--[no-]insights-config-query-insights-enabled
Use --insights-config-query-insights-enabled
to enable and --no-insights-config-query-insights-enabled
to disable.
--insights-config-query-plans-per-minute
=INSIGHTS_CONFIG_QUERY_PLANS_PER_MINUTE
--insights-config-query-string-length
=INSIGHTS_CONFIG_QUERY_STRING_LENGTH
--[no-]insights-config-record-application-tags
Use --insights-config-record-application-tags
to enable and --no-insights-config-record-application-tags
to disable.
--[no-]insights-config-record-client-address
Use --insights-config-record-client-address
to enable and --no-insights-config-record-client-address
to disable.
--instance-type
=INSTANCE_TYPE
INSTANCE_TYPE
must be one of:
CLOUD_SQL_INSTANCE
READ_POOL_INSTANCE
READ_REPLICA_INSTANCE
--maintenance-release-channel
=MAINTENANCE_RELEASE_CHANNEL
MAINTENANCE_RELEASE_CHANNEL
must be one of:
preview
production
week5
--maintenance-window-day
=MAINTENANCE_WINDOW_DAY
MAINTENANCE_WINDOW_DAY
must be one of: SUN
, MON
, TUE
, WED
, THU
, FRI
, SAT
.
--maintenance-window-hour
=MAINTENANCE_WINDOW_HOUR
--master-instance-name
=MASTER_INSTANCE_NAME
--memory
=MEMORY
--network
=NETWORK
--network
=projects/testproject/global/networks/testsharednetwork
--node-count
=NODE_COUNT
--password-policy-complexity
=PASSWORD_POLICY_COMPLEXITY
PASSWORD_POLICY_COMPLEXITY
must be one of:
COMPLEXITY_DEFAULT
COMPLEXITY_UNSPECIFIED
--[no-]password-policy-disallow-username-substring
--password-policy-disallow-username-substring
to enable and --no-password-policy-disallow-username-substring
to disable.
--password-policy-min-length
=PASSWORD_POLICY_MIN_LENGTH
--password-policy-password-change-interval
=PASSWORD_POLICY_PASSWORD_CHANGE_INTERVAL
--password-policy-reuse-interval
=PASSWORD_POLICY_REUSE_INTERVAL
--psc-auto-connections
=[network
=NETWORK
],[project
=PROJECT
]
psc-auto-connections
=network=projects/testproject1/global/networks/testnetwork1
" or "the form psc-auto-connections
=project=testproject1,network=projects/testproject1/global/networks/testnetwork1
". Sets psc_auto_connections
value.
network
network
value.
project
project
value.
Shorthand Example:
--psc-auto-connections=network=string,project=string
JSON Example:
--psc-auto-connections='{"network": "string", "project": "string"}'
File Example:
--psc-auto-connections=path_to_file.(yaml|json)
--[no-]recreate-replicas-on-primary-crash
--recreate-replicas-on-primary-crash
to enable and --no-recreate-replicas-on-primary-crash
to disable.
--replica-type
=REPLICA_TYPE
REPLICA_TYPE
must be one of: READ
, FAILOVER
.
--replication
=REPLICATION
REPLICATION
must be one of: synchronous
, asynchronous
.
--require-ssl
--[no-]retain-backups-on-delete
--retain-backups-on-delete
to enable and --no-retain-backups-on-delete
to disable.
--retained-backups-count
=RETAINED_BACKUPS_COUNT
--retained-transaction-log-days
=RETAINED_TRANSACTION_LOG_DAYS
--root-password
=ROOT_PASSWORD
--server-ca-mode
=SERVER_CA_MODE
SERVER_CA_MODE
must be one of:
CUSTOMER_MANAGED_CAS_CA
GOOGLE_MANAGED_CAS_CA
GOOGLE_MANAGED_INTERNAL_CA
--server-ca-pool
=SERVER_CA_POOL
--ssl-mode
=SSL_MODE
SSL_MODE
must be one of:
ALLOW_UNENCRYPTED_AND_ENCRYPTED
ENCRYPTED_ONLY
TRUSTED_CLIENT_CERTIFICATE_REQUIRED
--[no-]storage-auto-increase
--storage-auto-increase
to enable and --no-storage-auto-increase
to disable.
--storage-provisioned-iops
=STORAGE_PROVISIONED_IOPS
--storage-provisioned-throughput
=STORAGE_PROVISIONED_THROUGHPUT
--storage-size
=STORAGE_SIZE
--storage-type
=STORAGE_TYPE
STORAGE_TYPE
must be one of: SSD
, HDD
, HYPERDISK_BALANCED
.
--tags
=TAG
=VALUE
,[TAG
=VALUE
,…]
--tags tag1:value1,tag2=value2
)
--threads-per-core
=THREADS_PER_CORE
--tier
=TIER
, -t
TIER
db-g1-small
. For all other instances, instead of using tiers, customize your instance by specifying its CPU and memory. You can do so with the --cpu
and --memory
flags. Learn more about how CPU and memory affects pricing: https://cloud.google.com/sql/pricing.
--time-zone
=TIME_ZONE
--timeout
=TIMEOUT
; default=3600
unlimited
.
--allowed-psc-projects
=PROJECT
,[PROJECT
,…]
--enable-private-service-connect
--disk-encryption-key
=DISK_ENCRYPTION_KEY
To set the kms-key
attribute:
--disk-encryption-key
on the command line.This flag argument must be specified if any of the other arguments in this group are specified.
--disk-encryption-key-keyring
=DISK_ENCRYPTION_KEY_KEYRING
To set the kms-keyring
attribute:
--disk-encryption-key
on the command line with a fully specified name;--disk-encryption-key-keyring
on the command line.--disk-encryption-key-location
=DISK_ENCRYPTION_KEY_LOCATION
To set the kms-location
attribute:
--disk-encryption-key
on the command line with a fully specified name;--disk-encryption-key-location
on the command line.--disk-encryption-key-project
=DISK_ENCRYPTION_KEY_PROJECT
To set the kms-project
attribute:
--disk-encryption-key
on the command line with a fully specified name;--disk-encryption-key-project
on the command line;core/project
.--region
=REGION
; default="us-central"
--gce-zone
=GCE_ZONE
Flag --gce-zone
is deprecated and will be removed by release 255.0.0. Use --zone
instead.
--secondary-zone
=SECONDARY_ZONE
--zone
=ZONE
--access-token-file
, --account
, --billing-project
, --configuration
, --flags-file
, --flatten
, --format
, --help
, --impersonate-service-account
, --log-http
, --project
, --quiet
, --trace-token
, --user-output-enabled
, --verbosity
.
Run $ gcloud help
for details.
gcloud alpha sql instances create
gcloud beta sql instances create
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4