Cloud SQL for MySQL
Features
- Fully managed MySQL Community Edition databases in the cloud.
- Cloud SQL instances support MySQL 8.0, 5.7 (default), and 5.6, and provide up to 624 GB of RAM and 64 TB of data storage, with the option to automatically increase the storage size, as needed.
- Create and manage instances in the Google Cloud Console.
- Instances available in the Americas, EU, Asia, and Australia. See all locations.
- Customer data encrypted on Google's internal networks and in database tables, temporary files, and backups.
- Support for secure external connections with the Cloud SQL Auth proxy or with the SSL/TLS protocol.
- Support for private IP (private services access).
- Data replication between multiple zones with automatic failover.
- Import and export databases using
mysqldump, or import and export CSV files. - Support for MySQL wire protocol and standard MySQL connectors.
- Automated and on-demand backups and point-in-time recovery.
- Instance cloning.
- Integration with Google Cloud's operations suite logging and monitoring.
- ISO/IEC 27001 compliant.
Supported languages
You can use Cloud SQL for MySQL with App Engine applications running in the flexible environment that are written in C#, Go, Java, Node.js, PHP, Python, and Ruby. You can also use Cloud SQL with external applications using the standard MySQL protocol.
How you can connect to Cloud SQL instances
You can connect to a Cloud SQL instance for MySQL from:
- A
mysqlclient. Learn more. - Third-party tools like SQL Workbench or Toad for MySQL. Learn more.
- External applications. Learn more.
- App Engine applications. Learn more.
- Applications running on Compute Engine. Learn more.
- Applications running on Google Kubernetes Engine. Learn more.
- Cloud Functions. Learn more.
- Cloud Run. Learn more.
- Google Apps Script scripts Learn more.
Connecting to Cloud SQL by using Private Google access is not supported. Private services access is supported. For more information, see Private Access Options for Services.
User management in MySQL for Cloud SQL 8.0
Due to changes in MySQL 8.0, you can't use CREATE, or DELETE for MySQL
users management. You also can't modify user privileges using INSERT,
UPDATE, or DELETE statements. Instead, use CREATE and DROP USER and
GRANTand REVOKE statements to modify user privileges. For more information,
see Account management notes.
Note: Disregard information under Account management notes about running
mysql_upgrade to upgrade to version 8.0. Instead, upgrade using the procedure
in Upgrading MySQL on an instance.
Differences between Cloud SQL and standard MySQL functionality
In general, the MySQL functionality provided by a Cloud SQL instance is the same as the functionality provided by a locally-hosted MySQL instance. However, there are a few differences between a standard MySQL instance and a Cloud SQL instance.
Unsupported MySQL features
The following feature is unsupported for MySQL for Cloud SQL 5.6 and 5.7:
The following features are unsupported for MySQL for Cloud SQL 8.0:
Unsupported plugins
- InnoDB memcached plugin
- X plugin
- Clone plugin
- InnoDB data-at-rest encryption
- validate_password component
Unsupported statements
The following SQL statements generate an error with the message"Error 1290: The MySQL server is running with the Google option so it cannot execute this statement":
LOAD DATA INFILENote that
LOAD DATA LOCALINFILEis supported.SELECT ... INTO OUTFILESELECT ... INTO DUMPFILEINSTALL PLUGIN ...UNINSTALL PLUGINCREATE FUNCTION ... SONAME ...
The following statements are not supported because MySQL instances use GTID replication:
CREATE TABLE ... SELECTstatements- Transactions or statements that update both transactional and nontransactional tables
The following statement is unsupported in MySQL for MySQL for Cloud SQL 5.6 and 5.7, but is supported in MySQL for Cloud SQL 8.0.
CREATE TEMPORARY TABLEstatements inside transactions
For more information, see the MySQL documentation.
Unsupported functions
LOAD_FILE()
Unsupported client program features
mysqlimportwithout using the--localoption. This is because of theLOAD DATA INFILErestriction. If you need to load data remotely, use the Cloud SQL import function.mysqldumpusing the--taboption or options that are used with--tab. This is because the FILE privilege is not granted for instance users. All othermysqldumpoptions are supported.If you want to import databases with binary data into your Cloud SQL for MySQL instance, you must use the
--hex-bloboption withmysqldump.Although
hex-blobis not a required flag when you are using a local MySQL server instance and themysqlclient, it is required if you want to import any databases with binary data into your Cloud SQL instance. For more information about importing data, see Importing Data.Not all MySQL options and parameters are enabled for editing as Cloud SQL flags.
To request the addition of a configurable Cloud SQL flag, use the Cloud SQL Discussion group.
InnoDB is the only supported storage engine. For help with converting tables from MyISAM to InnoDB, see the MySQL documentation.
MySQL options preset on Cloud SQL
Cloud SQL runs MySQL with a specific set of options. If an option might impact how your applications work, we note it here for your information.
skip-name-resolve
This flag impacts how hostnames are resolved for client connections. Learn more.
log_bin
This flag reports whether binary logging is enabled. If the --log-bin option is
used, then the value of this variable is ON; otherwise it is OFF.
Learn more.
MySQL 8.0 authentication
MySQL 8.0 for Cloud SQL uses mysql_native_password as the default
authentication plugin for new users instead of caching_sha2_password. The
mysql_native_password plugin is the default for MySQL 5.6 and 5.7 users.
If you want new users to use the caching_sha2_password plugin as the default authentication, you can configure
your instance flag for default_authentication_plugin to use
caching_sha2_password."
To configure existing users to use caching_sha2_password, use the ALTER USER
command to change the authentication plugin.
Users that have the caching_sha2_password authentication might need to use
the get-server-public-key
flag when connecting. For details, see the MySQL docs section on
Using SHA-2 Pluggable Authentication.
Changes to MySQL system flags in Cloud SQL
On some MySQL system flags, Cloud SQL uses values that are different from the default value. You can't change these system flags. For a list of flags, see MySQL system flags changed in Cloud SQL.
Unsupported Cloud SQL feature in MySQL 8.0 for Cloud SQL
MySQL 8.0 for Cloud SQL does not support the legacy version of MySQL high availability (HA) configuration that uses failover replicas. It supports the new regional HA configuration.
Cloud SQL for PostgreSQL
Features
- Fully managed PostgreSQL databases in the cloud.
- Custom machine types with up to 624 GB of RAM and 96 CPUs.
- Up to 64 TB of storage available, with the ability to automatically increase storage size as needed.
- Create and manage instances in the Google Cloud Console.
- Instances available in the Americas, EU, Asia, and Australia. See all locations.
- Customer data encrypted on Google's internal networks and in database tables, temporary files, and backups.
- Support for secure external connections with the Cloud SQL Auth proxy or with the SSL/TLS protocol.
- Data replication between multiple zones with automatic failover.
- Import and export databases using SQL dump files.
- Support for PostgreSQL client-server protocol and standard PostgreSQL connectors.
- Automated and on-demand backups and point-in-time recovery.
- Instance cloning.
- Integration with Google Cloud's operations suite logging and monitoring.
- Support for multiple PostgreSQL versions.
- Logical replication
Supported extensions
Cloud SQL supports many PostgreSQL extensions. For a complete list, see PostgreSQL Extensions.
Supported procedural languages
Cloud SQL supports the
PL/pgSQL SQL procedural language.
Supported languages
You can use Cloud SQL for PostgreSQL with App Engine applications running in the flexible environment that are written in C#, Go, Java, Node.js, PHP, Python, and Ruby. You can also use Cloud SQL with external applications using the standard PostgreSQL client-server protocol.
How you can connect to Cloud SQL instances
You can connect to a Cloud SQL instance for PostgreSQL from:
- A
psqlclient. Learn more. - Third-party tools that use the standard PostgreSQL client-server protocol.
- External applications. Learn more.
- App Engine applications. Learn more.
- Applications running on Compute Engine. Learn more.
- Applications running on Google Kubernetes Engine. Learn more.
- Cloud Functions. Learn more.
- Cloud Run. Learn more.
Connecting to Cloud SQL by using Private Google access is not supported.
Differences between Cloud SQL and standard PostgreSQL functionality
In general, the PostgreSQL functionality provided by a Cloud SQL instance is the same as the functionality provided by a locally-hosted PostgreSQL instance. However, there are a few differences between a standard PostgreSQL instance and a Cloud SQL instance.
Unsupported features
Any features that require
SUPERUSERprivilegesAn exception to this rule is made for the
CREATE EXTENSIONstatement, but only for supported extensions.Custom background workers
The
psqlclient in Cloud Shell does not support operations that require a reconnection, such as connecting to a different database using the\ccommand.Low-Level Virtual Machine (LLVM) Just-in-Time (JIT) compilation.
Notable differences
There are some PostgreSQL options and parameters that are not enabled for editing as Cloud SQL flags.
To request the addition of a configurable Cloud SQL flag, use the Cloud SQL Discussion group.
Cloud SQL for SQL Server
Features
- Fully managed SQL Server databases in the cloud.
- Custom machine types with up to 624 GB of RAM and 96 CPUs.
- Up to 64 TB of storage available, with the ability to automatically increase storage size as needed.
- Create and manage instances in the Google Cloud Console.
- Instances available in the Americas, EU, Asia or Australia. See all locations.
- Customer data encrypted on Google's internal networks and in database tables, temporary files, and backups.
- Column- and cell-level encryption for user databases.
- Support for secure external connections with the Cloud SQL Auth proxy or with the SSL/TLS protocol.
- Import databases using BAK and SQL files.
- Export databases using BAK files.
- Automated and on-demand backups.
- Instance cloning.
- Integration with Stackdriver logging and monitoring.
- SQL Server Agent enabled to facilitate replication and other jobs.
- Data replication between multiple regions.
- Set a default collation for databases, when creating an instance.
- High availability through regional persistent disk.
- Integration with Managed Service for Microsoft Active Directory, including Windows Authentication.
- Change Data Capture (CDC).
- Intelligent query processing.
- Accelerated database recovery.
- Enhanced data classification.
- UTF-8 character encoding support.
- Enhanced monitoring.
SQL Server features unavailable for Cloud SQL
The following features are unavailable in Cloud SQL and not supported by Google Cloud support.
General features unavailable for Cloud SQL
- SQL Server Reporting Services (SSRS), but you can use Compute Engine or a self-managed environment (from which you connect to Cloud SQL)
- SQL Server Analysis Services (SSAS), but you can use Compute Engine or a self-managed environment (from which you connect to Cloud SQL)
- SQL Server Integration Services (SSIS), but you can use Compute Engine or a self-managed environment (from which you connect to Cloud SQL)
- SP_Configure settings (but see Configuring database flags)
- Stretch database
- Backing up to Microsoft Azure Blob Storage
- Buffer pool extension
- BULK INSERT and OPENROWSET(BULK...) features
- The OPENROWSET feature
- Data Quality Services
- Database Log Shipping
- Database Mail
- Distribution Transaction Coordinator (MSDTC)
- File tables
- FILESTREAM support
- Maintenance Plans
- Performance Data Collector
- Policy-Based Management
- PolyBase
- Machine Learning and R Services (requires OS access to install it)
- Resource Governor
- SQL Server Audit
- Server-level triggers
- Service Broker endpoints
- T-SQL endpoints (all operations using
CREATE ENDPOINTare unavailable) - WCF Data Services
- The
sysadminrole and system stored procedures that require it - Linked Servers
- Hybrid buffer pool
- Memory-optimized tempdb metadata
- In-Memory OLTP support for database snapshots
- Registering external languages
Other operations unavailable for Cloud SQL
- ADMINISTER BULK OPERATIONS
- ALTER ANY CREDENTIAL
- ALTER ANY EVENT NOTIFICATION
- ALTER ANY EVENT SESSION
- ALTER ANY SERVER AUDIT
- ALTER RESOURCES
- ALTER SETTINGS
- AUTHENTICATE SERVER
- CONTROL_SERVER
- CREATE DDL EVENT NOTIFICATION
- CREATE ENDPOINT
- CREATE TRACE EVENT NOTIFICATION
- EXTERNAL ACCESS ASSEMBLY
- RESTORE
- SHUTDOWN
- CLR ASSEMBLIES
Supported syntax
Cloud SQL supports the Transact-SQL syntax.
Supported languages
You can use Cloud SQL for SQL Server with App Engine applications running in the flexible environment that are written in C#, Go, Java, Node.js, PHP, Python, and Ruby.
How you can connect to Cloud SQL instances
You can connect to a Cloud SQL instance for SQL Server from:
Connecting to Cloud SQL by using Private Google access is not supported.