数据库管理和报告工具提供不同程度的支持来管理数据库。根据您需要执行的管理和报告类型选择工具。例如,如果您需要连接到一个数据库并发出一些 SQL 命令,请考虑使用 MySQL 客户端。请参阅使用 IP 地址连接 MySQL 客户端。如果您需要同时设计或管理许多数据库,则可以使用本文介绍的其中一个可视化工具。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-07。"],[],[],null,["# Connect from other MySQL tools\n\n\u003cbr /\u003e\n\nMySQL \\| PostgreSQL \\| SQL Server\n\n\u003cbr /\u003e\n\nThis page describes several common database\nadministration and reporting tools that you can use to connect to your Cloud SQL instances.\n\nOverview\n--------\n\nDatabase administration and reporting tools provide varying degrees of support\nfor managing your database. Select a tool based on the type of\nadministration and reporting that you need to do. For example, if you need to\nconnect to one database and issue a few SQL commands, consider\nusing the MySQL client.\nSee [Connecting MySQL Client Using IP Addresses](/sql/docs/mysql/connect-admin-ip).\nIf you need to design or manage many databases simultaneously, then\nuse one of the visual-based tools discussed here.\n\nWe discuss a limited number of tools in this page. If your tool\nis not discussed, it's likely that you can successfully connect by following\nthe steps for a similar tool.\n\nConnect with MySQL Workbench\n----------------------------\n\nThis section shows how to connect to your\nCloud SQL instance database with\n[MySQL Workbench](http://www.mysql.com/products/workbench/).\n| Note: Add your MySQL Workbench machine's IP address as an [authorized network](/sql/docs/mysql/authorize-networks) for your Cloud SQL instance.\n\n1. In the MySQL Workbench home view, click **New Connection**.\n2. In the **Setup new connection** form, provide a **Connection Name** , **Hostname** , **Username** , and **Default Schema** , if applicable, as show in Figure 1.\n\n\n Figure 1: New connection in MySQL Workbench **Setup New Connection** form.\n\n \u003cbr /\u003e\n\n3. Click **Test Connection**. You are prompted for a password.\n4. Optionally, click **Advanced** , and fill in the information for connecting with SSL as shown in Figure 2. Be sure to select **Use SSL if available** and specify an **SSL CA File** , an **SSL CERT File** , and an **SSL key File** . [Learn more](/sql/docs/mysql/authorize-ssl) about using SSL certificates with Cloud SQL.\n\n\n Figure 2: Specifying advanced options in the MySQL Workbench **Setup New Connection** form.\n\n \u003cbr /\u003e\n\n5. Click **Test Connection** to make sure all the advanced parameters are set correctly.\n6. Click **Close**.\n7. Connect with the connection you created.\n8. Once connected, you can test if you're using SSL by executing the following SQL statement: \n\n ```sql\n SHOW STATUS like 'ssl_cipher';\n ```\n\n\n Figure 3: Testing if the MySQL Workbench connection uses SSL.\n\n \u003cbr /\u003e\n\n[Back to top](#top)\n\nConnect with Toad for MySQL\n---------------------------\n\nThis section shows how to connect to your\nCloud SQL instance database with\n[Toad for MySQL](http://www.toadworld.com/products#mysql).\n\n1. In Toad for MySQL, create a new connection.\n2. In the **New MySQL Connection** form, fill in the following information:\n - **User**: The name of a user in your MySQL database.\n - **Password**: The password for the specified user.\n - **Host** : The IP address of your instance. For more information, see [Configuring Application Access Control](http://www.mysql.com/products/workbench/). If you've mapped the IP address to the hostname of your local server, you can use that in this field.\n - **Database**: The database instance to connect to.\n\n\n Figure 4: The Create New Connection dialog box in Toad for Mac\n\n \u003cbr /\u003e\n\n3. Click **Test Connection** to confirm that the connection information is correct.\n4. Click **OK** to start the connection.\n5. In the **Enter Password** dialog box, enter the password for the user. This dialog box appears because we did not choose **Save password (encrypted)** in the **Create New Connection** dialog box.\n\n### Configure Toad to use SSL\n\nIn Figure 5, a **Create New Connection** dialog box is shown\nwith information for connecting with SSL. All versions of Toad might not support\nconnecting with SSL.\nFigure 5: The Create New Connection dialog box in Toad for Windows\n\nOnce connected, you can test if you're using SSL by executing the following\nSQL statement and verifying that the `ssl_cipher` value is not empty: \n\n```sql\nSHOW STATUS like 'ssl_cipher';\n```\n\n[Back to top](#top)\n\nConnect with SQuirrel SQL\n-------------------------\n\nThis section shows how to connect to your\nCloud SQL instance database with\n[SQuirrel SQL](http://www.squirrelsql.org/).\n\n1. In the SQuirrel SQL client, select the **Aliases** panel to make it active.\n2. In the **Aliases** menu, select **New Alias**.\n3. Fill out the information, as shown in Figure 6. Be sure to select the MySQL Driver and provide values for \u003cvar translate=\"no\"\u003e<instance-ip>\u003c/var\u003e, \u003cvar translate=\"no\"\u003e<database>\u003c/var\u003e, and \u003cvar translate=\"no\"\u003e<user-name>\u003c/var\u003e. **Note:** The connection URL for using SSL is of the form:\n | `jdbc:mysql://\u003cinstance-ip\u003e:3306/\u003cdatabase\u003e?verifyServerCertificate=true&useSSL=true&requireSSL=true`.\n | However, to use SSL, you must specify truststore files created from the CA certificate,\n | the client certificate, and the client key you obtained when you created an SSL certificate.\n | For more information, see [Configuring a SQuirrel SQL connection to use SSL](#squirrel-ssl).\n\n\n Figure 6: Configuring a SQuirrel SQL connection to MySQL.\n\n \u003cbr /\u003e\n\n4. Click **Test** to test the connection. You are prompted for a password.\n5. Click **OK** to save the alias.\n6. In the **Aliases** panel, right-click the alias you created and select **Connect**.\n\n### Configure SQuirrel SQL to use SSL\n\nThis section assumes that you've created an SSL certificate\n(see [Configuring SSL for an instance](/sql/docs/mysql/configure-ssl-instance))\nand you have three files:\n\n- A CA certificate file, for example, **ca-cert.pem**.\n- A client public key certificate file, for example, **client-cert.pem**.\n- A client private key file, for example, **client-key.pem**.\n\nUse these files as described in\n[Connecting Securely Using SSL](http://dev.mysql.com/doc/connector-j/en/connector-j-reference-using-ssl.html) in the\nMySQL Reference Manual to create keystore and truststore files. You need to specify the\nkeystore and truststore files when you start SQuirrel SQL. One way to do\nthis is to edit the script that launches the SQuirrel SQL application as follows: \n\n```\n$JAVACMD -Djavax.net.ssl.keyStore=\u003cpath-to-keystore\u003e \\\n -Djavax.net.ssl.keyStorePassword=\u003ckeystore-password\u003e \\\n -Djavax.net.ssl.trustStore=\u003cpath-to-truststore\u003e \\\n -Djavax.net.ssl.trustStorePassword=\u003ctruststore-password\u003e \\\n [existing launch parameters]\n```\n\nAfter you've started SQuirrel SQL with the valid keystore and truststore information, you\ncan connect with: \n\n```\njdbc:mysql://\u003cinstance-ip\u003e:3306/\u003cdatabase\u003e?verifyServerCertificate=true&useSSL=true&requireSSL=true\n```\n\nOnce connected, you can test if you're using SSL by executing the following\nSQL statement and verifying that the `ssl_cipher` value is not empty: \n\n```sql\nSHOW STATUS like 'ssl_cipher';\n```\n\n[Back to top](#top)"]]