Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Microsoft SQL Server (MS-SQL) memiliki fitur yang disebut instance bernama. Fitur ini memungkinkan Anda menjalankan beberapa database di host yang sama (atau host cluster) dengan setelan terpisah. Setiap instance database berjalan di port-nya sendiri. Namun, saat menggunakan klien yang mendukung MS-SQL yang berjalan di Windows, Anda dapat terhubung berdasarkan nama, bukan berdasarkan nomor port. Misalnya, jika nama host Anda adalah dbserver dan instance Anda bernama proddb, Anda akan terhubung menggunakan nama host dbserver\proddb.
Cara instance bernama MS-SQL terhubung
Klien Anda menghubungi host, yang diberi nama di port MS-SQL default (1433).
MS-SQL merespons dengan port instance bernama.
Kemudian, klien akan terhubung ke port tersebut.
Looker tidak akan dapat menemukan nomor port instance bernama dengan cara ini. Setelah terhubung ke port, Looker diharapkan dapat menjalankan kueri dan tidak akan terhubung dengan port lain.
Cara menghubungkan instance bernama MS-SQL dengan Looker
MS-SQL memilih port acak saat dimulai. Agar Looker dapat terhubung ke instance bernama MS-SQL, Anda harus menemukan port tempat instance bernama tersebut berjalan:
Setelah menemukan port, Anda dapat memasukkan nama port di kolom Host:Port dalam konfigurasi koneksi database Looker. Misalnya, jika port-nya adalah 61499 dan host-nya bernama dbserver, koneksi di Looker akan terlihat seperti ini:
host: dbserver
port: 61499
CATATAN: Nama host database tidak akan menggunakan format dbserver\proddb, seperti yang akan terjadi jika Anda terhubung dengan nama instance.
Perlu diperhatikan bahwa MS-SQL dapat memilih port yang berbeda untuk instance bernama setiap kali server dimulai ulang. Hal ini dapat mengharuskan MS-SQL mengubah aturan firewall dan mengonfigurasi ulang Looker untuk menggunakan port baru. Untuk menghindari perubahan port, Anda dapat memilih untuk menetapkan port statis ke instance bernama; lihat Cara Menetapkan Port Statis ke Instance Bernama SQL Server — dan Menghindari Perangkap Umum untuk mengetahui detail prosesnya.
[[["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-07-31 UTC."],[],[],null,["# Connecting an MS-SQL named instance\n\nMicrosoft SQL Server (MS-SQL) has a feature called [**named instances**](https://serverfault.com/a/80771). This feature lets you run multiple databases on the same host (or clustered hosts) with separate settings. Each database instance runs on its own port. However, when using MS-SQL--aware clients running on Windows, you can connect by name instead of by port number. For example, if your hostname is `dbserver` and your instance is named `proddb`, you would connect using the hostname `dbserver\\proddb`.\n\n\nHow MS-SQL named instances connect\n----------------------------------\n\n\u003cbr /\u003e\n\n1. Your client contacts the host, named on the default MS-SQL port (1433).\n2. MS-SQL responds with the named instance's port.\n3. The client then connects to that port.\n\n\nLooker will be unable to find the port number of a named instance in this way. Once Looker connects to a port, it expects to be able to run queries and will not connect with any other port.\n\nHow to connect an MS-SQL named instance with Looker\n---------------------------------------------------\n\nMS-SQL chooses a random port at startup. For Looker to connect to an MS-SQL named instance, you will need to find the port the named instance is running on:\n\n- The article [SQL Server --- Finding TCP Port Number SQL Instance Is Listening On](http://sqlandme.com/2013/05/01/sql-server-finding-tcp-port-number-sql-instance-is-listening-on/) details the method for finding the port. Although the article is from 2012, the procedure is similar across the various versions of MS-SQL.\n- Once you've found the port, you can enter the port name in the [`Host:Port`](/looker/docs/connecting-to-your-db#host:port) field in Looker's database connection configuration. For example, if the port is `61499` and the host is named `dbserver`, the connection in Looker will look like this:\n\n \u003cbr /\u003e\n\n\n ```\n host: dbserver\n port: 61499\n ```\n\u003e ***NOTE:** The database hostname will **not** take the form `dbserver\\proddb`, as it would if you were connecting by the instance name.*\n- it is important to note that MS-SQL may choose a different port for the named instance whenever the server is rebooted. This could require MS-SQL to change firewall rules and reconfigure Looker to use the new port. To avoid ports changing, you can choose to assign a static port to your named instance; see [How to Assign a Static Port to a SQL Server Named Instance --- and Avoid a Common Pitfall](https://www.heelpbook.net/2015/how-to-assign-static-port-to-a-sql-server-named-instance/) for details on the process."]]