gcloud database-migration connection-profiles create mysql Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud database-migration connection-profiles create mysql - create a Database Migration Service connection profile for MySQL
- SYNOPSIS
gcloud database-migration connection-profiles create mysql(CONNECTION_PROFILE:--region=REGION)[--no-async][--cloudsql-instance=CLOUDSQL_INSTANCE][--display-name=DISPLAY_NAME][--labels=[KEY=VALUE,…]][--provider=PROVIDER][--role=ROLE][--ca-certificate=CA_CERTIFICATE:--ssl-type=SSL_TYPE--client-certificate=CLIENT_CERTIFICATE--private-key=PRIVATE_KEY][--host=HOST--port=PORT--username=USERNAME:--password=PASSWORD|--prompt-for-password][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
- Create a Database Migration Service connection profile for MySQL.
- EXAMPLES
- To create a connection profile for MySQL:
gclouddatabase-migrationconnection-profilescreatemysqlmy-profile--region=us-central1--password=123456--username=my-user--host=1.2.3.4--port=3306If the source is a Cloud SQL database, run:
gclouddatabase-migrationconnection-profilescreatemysqlmy-profile--region=us-central1--password=123456--username=my-user--host=1.2.3.4--port=3306--cloudsql-instance=my-instance--provider=CLOUDSQL - POSITIONAL ARGUMENTS
- Connection profile resource - The connection profile to create. The arguments inthis group can be used to specify the attributes of this resource. (NOTE) Someattributes are not given arguments in this group but can be set in other ways.
To set the
projectattribute:- provide the argument
connection_profileon the command line with afully specified name; - provide the argument
--projecton the command line; - set the property
core/project.
This must be specified.
CONNECTION_PROFILE- ID of the connection_profile or fully qualified identifier for theconnection_profile.
To set the
connection_profileattribute:- provide the argument
connection_profileon the command line.
This positional argument must be specified if any of the other arguments in thisgroup are specified.
- provide the argument
--region=REGION- The Cloud region for the connection_profile.
To set the
regionattribute:- provide the argument
connection_profileon the command line with afully specified name; - provide the argument
--regionon the command line.
- provide the argument
- provide the argument
- Connection profile resource - The connection profile to create. The arguments inthis group can be used to specify the attributes of this resource. (NOTE) Someattributes are not given arguments in this group but can be set in other ways.
- FLAGS
--no-async- Waits for the operation in progress to complete before returning.
--cloudsql-instance=CLOUDSQL_INSTANCE- If the source or destination is a Cloud SQL database, then use this field toprovide the respective Cloud SQL instance ID.
--display-name=DISPLAY_NAME- A user-friendly name for the connection profile. The display name can includeletters, numbers, spaces, and hyphens, and must start with a letter.
--labels=[KEY=VALUE,…]- List of label KEY=VALUE pairs to add.
Keys must start with a lowercase character and contain only hyphens(
-), underscores (_), lowercase characters, andnumbers. Values must contain only hyphens (-), underscores(_), lowercase characters, and numbers. --provider=PROVIDER- Database provider, for managed databases.
PROVIDERmustbe one of:RDS,CLOUDSQL. --role=ROLE- The role of the connection profile.
ROLEmust be one of:SOURCE,DESTINATION. --ca-certificate=CA_CERTIFICATE- x509 PEM-encoded certificate of the CA that signed the database server'scertificate. The value for this flag needs to be the content of the certificatefile, not the path to the file. For example, on a Linux machine you can usecommand substitution:<code>--ca-certificate=$(</path/to/certificate_file.pem)</code>.Database Migration Service will use this certificate to verify it's connectingto the correct host. Database Migration Service encrypts the value when storingit.
--ssl-type=SSL_TYPE- The type of SSL configuration.
SSL_TYPEmust be one of:SERVER_ONLY,SERVER_CLIENT,REQUIRED,NONE. --client-certificate=CLIENT_CERTIFICATE- x509 PEM-encoded certificate that will be used by the replica to authenticateagainst the database server. The value for this flag needs to be the content ofthe certificate file, not the path to the file. For example, on a Linux machineyou can use command substitution:<code>--ca-certificate=$(</path/to/certificate_file.pem)</code>.Database Migration Service encrypts the value when storing it.
--private-key=PRIVATE_KEY- Unencrypted PKCS#1 or PKCS#8 PEM-encoded private key associated with the ClientCertificate. The value for this flag needs to be the content of the certificatefile, not the path to the file. For example, on a Linux machine you can usecommand substitution:<code>--ca-certificate=$(</path/to/certificate_file.pem)</code>.Database Migration Service encrypts the value when storing it.
--host=HOST- IP or hostname of the database. When
--psc-service-attachmentisalso specified, this field value should be:1. For Cloud SQL PSC enabled instance - the dns_name field (e.g<uid>.<region>.sql.goog.).
2. For Cloud SQL PSA instance (vpc peering) - the private ip of the instance.
3. For AlloyDB PSC enabled cluster - the dns_name field of the primary instance(e.g <uid>.<region>.alloydb-psc.goog.).
4. For AlloyDB PSA cluster - the private ip of the primary instance.
--port=PORT- Network port of the database.
--username=USERNAME- Username that Database Migration Service uses to connect to the database.Database Migration Service encrypts the value when storing it.
- At most one of these can be specified:
--password=PASSWORD- Password for the user that Database Migration Service uses to connect to thedatabase. Database Migration Service encrypts the value when storing it, and thefield is not returned on request.
--prompt-for-password- Prompt for the password used to connect to the database.
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--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 helpfor details. - NOTES
- This variant is also available:
gcloudalphadatabase-migrationconnection-profilescreatemysql
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-16 UTC.