Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
MySQL | PostgreSQL | SQL Server
Halaman ini menjelaskan beberapa administrasi database umum
dan alat pelaporan umum yang dapat Anda gunakan untuk terhubung ke instance Cloud SQL.
Ringkasan
Administrasi database dan alat pelaporan menyediakan berbagai tingkat dukungan
untuk mengelola database Anda. Pilih alat berdasarkan jenis
administrasi dan pelaporan yang perlu Anda lakukan. Misalnya, jika Anda perlu
terhubung ke satu database dan mengeluarkan beberapa perintah SQL, pertimbangkan
untuk menggunakan klien MySQL.
Lihat Menghubungkan Klien MySQL Menggunakan Alamat IP.
Jika Anda perlu mendesain atau mengelola banyak database secara bersamaan,
gunakan salah satu alat berbasis visual yang dibahas di sini.
Kami membahas sejumlah alat yang terbatas di halaman ini. Jika alat Anda
tidak dibahas, ada kemungkinan Anda berhasil terhubung dengan mengikuti
langkah-langkah untuk alat serupa.
Hubungkan dengan MySQL Workbench
Bagian ini menunjukkan cara menghubungkan ke database
instance Cloud SQL dengan
MySQL Workbench.
Di tampilan home MySQL Workbench, klik Koneksi Baru.
Dalam formulir Menyiapkan koneksi baru, masukkan
Nama Koneksi, Nama host,
Nama Pengguna, dan Schema Default, jika berlaku,
seperti yang ditunjukkan pada Gambar 1.
Gambar 1: Koneksi baru di MySQL Workbench
Menyiapkan Koneksi Baru.
KlikUji Koneksi. Anda akan diminta untuk memasukkan sandi.
Secara opsional, klik Lanjutan, lalu isi informasi
untuk menghubungkan dengan SSL, seperti yang ditunjukkan pada Gambar 2. Pastikan untuk memilih
Gunakan SSL jika tersedia dan tentukan File SSL CA,
File SSL CERT, dan File kunci SSL.
Pelajari lebih lanjut cara menggunakan sertifikat SSL
dengan Cloud SQL.
Gambar 2: Menentukan opsi lanjutan di formulir Menyiapkan Koneksi Baru MySQL Workbench.
Klik Uji Koneksi untuk memastikan semua parameter
lanjutan telah ditetapkan dengan benar.
Klik Close.
Hubungkan dengan koneksi yang Anda buat.
Setelah terhubung, Anda dapat menguji apakah Anda menggunakan SSL dengan menjalankan
pernyataan SQL berikut:
SHOWSTATUSlike'ssl_cipher';
Gambar 3: Menguji apakah koneksi MySQL Workbench menggunakan SSL.
Bagian ini menunjukkan cara terhubung ke
database instance Cloud SQL dengan
Toad untuk MySQL.
Di Toad untuk MySQL, buat koneksi baru.
Dalam formulir Koneksi Baru MySQL, isi
informasi berikut:
Pengguna: Nama pengguna di
database MySQL Anda.
Sandi: Sandi untuk pengguna yang ditentukan.
Host: Alamat IP instance Anda.
Untuk informasi selengkapnya, lihat
Mengonfigurasi Kontrol Akses Aplikasi. Jika telah memetakan alamat IP
ke nama host server lokal, Anda dapat menggunakannya di kolom ini.
Database: Instance database yang akan dihubungkan.
Gambar 4: Kotak dialog Buat Koneksi Baru di Toad untuk Mac
Klik Uji Koneksi untuk mengonfirmasi bahwa informasi
koneksi sudah benar.
Klik OK untuk memulai koneksi.
Pada kotak dialog Masukkan Sandi, masukkan sandi
untuk pengguna. Kotak dialog ini muncul karena kami tidak memilih
Simpan sandi (terenkripsi) di kotak dialog
Buat Koneksi Baru.
Mengonfigurasi Toad untuk menggunakan SSL
Dalam Gambar 5, kotak dialog Buat Koneksi Baru ditampilkan
dengan informasi untuk menghubungkan dengan SSL. Semua versi Toad mungkin tidak mendukung
koneksi dengan SSL.
Gambar 5: Kotak dialog Buat Koneksi Baru di Toad untuk Windows
Setelah terhubung, Anda dapat menguji apakah Anda menggunakan SSL dengan menjalankan
pernyataan SQL berikut dan memverifikasi bahwa nilai ssl_cipher tidak kosong:
Bagian ini menunjukkan cara menghubungkan ke
database instance Cloud SQL dengan
SQuirrel SQL.
Pada klien SQuirrel SQL, pilih panel Aliases untuk
mengaktifkannya.
Di menu Alias, pilih Alias Baru.
Isi informasinya, seperti yang ditunjukkan pada Gambar 6. Pastikan untuk memilih
Driver MySQL dan memberikan nilai untuk <instance-ip>, <database>,
dan <user-name>.
Gambar 6: Mengonfigurasi koneksi SQL SQuirrel ke MySQL.
Klik Uji untuk menguji koneksi. Anda akan diminta untuk memasukkan sandi.
Klik OK untuk menyimpan alias.
Di panel Alias, klik kanan alias yang Anda buat, lalu
pilih Hubungkan.
Mengonfigurasi SQuirrel SQL untuk menggunakan SSL
Bagian ini mengasumsikan bahwa Anda telah membuat sertifikat SSL
(lihat Mengonfigurasi SSL untuk instance)
dan Anda memiliki tiga file:
File sertifikat CA, misalnya, ca-cert.pem.
File public key certificate klien, misalnya, client-cert.pem.
Gunakan file ini seperti yang dijelaskan dalam
Menghubungkan dengan Aman Menggunakan SSL dalam
Panduan Referensi MySQL untuk membuat file keystore dan truststore. Anda perlu menentukan
file keystore dan truststore saat memulai SQuirrel SQL. Salah satu cara
melakukannya adalah dengan mengedit skrip yang meluncurkan aplikasi SQuirrel SQL sebagai berikut:
Setelah terhubung, Anda dapat menguji apakah Anda menggunakan SSL dengan menjalankan
pernyataan SQL berikut dan memverifikasi bahwa nilai ssl_cipher tidak kosong:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-04 UTC."],[],[],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)"]]