[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-19 (世界標準時間)。"],[],[],null,["# Manage your data using Cloud SQL Studio\n\n\u003cbr /\u003e\n\n[MySQL](/sql/docs/mysql/manage-data-using-studio \"View this page for the MySQL database engine\") \\| PostgreSQL \\| [SQL Server](/sql/docs/sqlserver/manage-data-using-studio \"View this page for the SQL Server database engine\")\n\n\u003cbr /\u003e\n\nThis page describes how to explore and manage your Cloud SQL data using\nCloud SQL Studio in the Google Cloud console.\n\nCloud SQL Studio lets authorized users interact directly with the SQL database\nand run SQL queries from the Google Cloud console to access and manipulate data.\nYou can perform a range of actions that\nyou would perform on a SQL command line client,\nsuch as creating tables and indexes, modifying tables, or setting up views.\n\nCloud SQL Studio includes an **Explorer** pane that integrates with a query\neditor and a SQL query results table. You can run DDL, DML, and DQL statements\nfrom this one interface. For example, instead of configuring a third-party\ndatabase query tool, you can create a table and query your data using the query\neditor in Cloud SQL Studio.\n\nYou can use the **Explorer** pane to view and interact with your database objects.\nYou create, alter, and delete the database objects, such as the following:\n\n- Tables\n- Columns\n- Indexes and keys\n- Functions\n\nYou can also use the **Explorer** pane to seed `SELECT` queries for tables.\n| **Note:** System-level views in the `INFORMATION_SCHEMA` and `PG_CATALOG` schema is read-only.\n\nIf you're new to Cloud SQL, see\n[Cloud SQL overview](/sql/docs/postgres/introduction).\n\n### Required roles and permissions\n\n\nTo get the permissions that\nyou need to complete the tasks in this document,\n\nask your administrator to grant you the\n\n\n[Cloud SQL Studio User](/iam/docs/roles-permissions/cloudsql#cloudsql.studioUser) (`roles/cloudsql.studioUser`)\nIAM role on the project.\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nYou might also be able to get\nthe required permissions through [custom\nroles](/iam/docs/creating-custom-roles) or other [predefined\nroles](/iam/docs/roles-overview#predefined).\n\nTo use Cloud SQL Studio, you must have the following permissions:\n\n- `cloudsql.databases.list`\n- `cloudsql.instances.executeSql`\n- `cloudsql.instances.get`\n- `cloudsql.instances.login` (only required if you're using IAM database authentication)\n- `cloudsql.users.list`\n\nAdditionally, ensure that you have database-level permissions for the database\nthat you're using for authentication, and the password for the privileged\ndatabase user that you're using.\n\n### Authenticate to Cloud SQL Studio\n\nBefore you can access a database in Cloud SQL Studio,\nyou must first select a database authentication method. To sign in to your\ndatabase using Cloud SQL Studio, you can use one of the following types of authentication:\n\n- [IAM database authentication](/sql/docs/postgres/iam-authentication#iam-db-auth). Using\n this type of authentication lets you sign in to your database and\n Cloud SQL Studio without having to manage an extra password.\n You can also take advantage of [IAM group authentication](/sql/docs/postgres/iam-authentication#iam-group-auth)\n and manage the database access and privileges for multiple users in your\n organization at the same time.\n\n- [Built-in database authentication](/sql/docs/postgres/built-in-authentication).\n You connect to the database in Cloud SQL Studio by using your PostgreSQL\n user account and credentials.\n\n### Explore your data\n\nTo access the **Explorer** pane, follow these steps:\n\n1. In the Google Cloud console, go to the **Cloud SQL Instances** page.\n\n [Go to Cloud SQL Instances](https://console.cloud.google.com/sql)\n2. Select an instance from the list.\n3. In the navigation menu, click **Cloud SQL Studio**.\n4. Sign in to Cloud SQL Studio using the name of your database, username, and password. The **Explorer** pane displays a list of the objects in your database.\n\n### Create, modify, and query your data\n\nUsing the SQL editor, you can run a combination of DDL, DML, and DQL statements.\nYou can compose a query yourself, or you can populate the query editor with a\ntemplate using the explorer.\n\nTo structure, modify, or query your data, follow these steps:\n\n1. In the Google Cloud console, go to the **Cloud SQL Instances** page.\n\n [Go to Cloud SQL Instances](https://console.cloud.google.com/sql)\n2. Select an instance from the list.\n3. In the navigation menu, click **Cloud SQL Studio**.\n4. Sign in to Cloud SQL Studio using the name of your database, username, and password.\n5. Compose a query using one of the following methods:\n - To compose your own query, follow these steps:\n 1. Open a new tab by clicking add.\n 2. When the query editor appears, write your query.\n - To compose a query starting with a template, follow these steps:\n 1. In the **Explorer** pane, next to a database object or collection, click more_vert **View actions**. One or more available actions appear.\n 2. Click an action. The query editor populates with a template.\n 3. Replace any placeholders in the template.\n6. Run your queries using either of the following approaches:\n - To execute all the statements in the query editor, click **Run**.\n - To run specific statements, select one or multiple statements, and click **Run selected**.\n7. The results of your queries appear in the **Results** tab. If multiple result sets are available, select a result from the **All results** drop-down list.\n\n### Limitations\n\n- Cloud SQL Studio supports lightweight queries. Responses over 10MB might be truncated. Cloud SQL Studio indicates when partial results are returned.\n- You can only run queries for Cloud SQL instances that are running.\n- Cloud SQL Studio doesn't support external servers.\n- Requests taking longer than five minutes are canceled. Setting a higher query timeout using `SET STATEMENT_TIMEOUT` isn't supported.\n- Cloud SQL Studio doesn't keep a database connection open after execution of a SQL script is completed. Similarly, editor tabs don't share a common session and every execution starts a new session.\n- When you run a mix of DML, DQL, and DDL statements, only results from the DQL queries will be displayed.\n- Closing your browser or browser tab doesn't stop the query execution in Cloud SQL Studio. The query will run until it completes or times out.\n\n\u003c!-- --\u003e\n\n- If you're running multiple statements in the query editor at the same time and one or more statements result in an error, then the execution of all statements is aborted and the first encountered error is displayed."]]