[[["容易理解","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-09-05 (世界標準時間)。"],[],[],null,["# Connect to Amazon Redshift\n\nThe Amazon Redshift connector lets you create data sources based on Amazon Redshift. You can then visualize that data in your Looker Studio reports and explorations.\n\nHow to connect to Amazon Redshift\n---------------------------------\n\nA Looker Studio data source can connect to a single Amazon Redshift database table or to a custom query that you provide.\n\n### To connect\n\n1. [Sign in to Looker Studio.](https://lookerstudio.google.com)\n\n2. On the Looker Studio home page, in the top left, click **Create** , and then select **Data Source**.\n\n3. Select the **Amazon Redshift** connector.\n\n4. Set up the connection to your database:\n\n #### Connect with a hostname or IP address\n\n 1. On the left, select **BASIC**.\n 2. Enter the connection details:\n 1. Hostname or IP address\n 2. Port (Optional)\n 3. Database\n 4. Username\n 5. Password\n\n \u003cbr /\u003e\n\n #### Connect with a JDBC URL\n\n 1. On the left, select **JDBC URL**.\n 2. Enter the connection details:\n 1. JDBC URL **Example** ` ` jdbc:redshift://\u003cvar class=\"edit\" translate=\"no\"\u003ehostname or IP address\u003c/var\u003e[:\u003cvar class=\"edit\" translate=\"no\"\u003eport\u003c/var\u003e]/\u003cvar class=\"edit\" translate=\"no\"\u003edatabase\u003c/var\u003e ` `\n\n 2. Username\n 3. Password\n | **Note:** Looker Studio can't connect to `localhost`. You must use a public hostname or IP address.\n5. Enable SSL: Looker Studio supports secure (encrypted) connections to the server using the TLS (Transport Layer Security) protocol. TLS is also referred to as SSL (Secure Sockets Layer). To enable a secure connection, check **Enable SSL**, then provide your SSL configuration files.\n\n | **Note:** This setting is not required by Looker Studio but may be required for your database configuration. Check with your database vendor for details.\n\n Learn more about [Amazon Redshift secure connections](https://docs.aws.amazon.com/redshift/latest/mgmt/connecting-ssl-support.html).\n6. Click **AUTHENTICATE.**\n\n7. Select a table from the list or enter a custom query.\n\n\nSelect the **CUSTOM QUERY** option to provide a SQL query instead of connecting to a single table. Looker Studio uses this custom SQL as an inner select statement for each generated query to the database.\n| **Note:** Custom SQL queries may only have a single statement.\n\nFor example, the following will **not** work because it has multiple SQL statements: \n\n\n DECLARE cost_per_tb_in_dollar FLOAT64 DEFAULT 4.2;\n\n SELECT total_bytes_billed / (1024 * 1024))* cost_per_tb_in_dollar)/(1024*1024))) FROM billing-table;\n\nQueries in Looker Studio may time out after three to five minutes. If your custom queries time out, try the following approaches to resolve the issue:\n\n- Simplify the query so that it runs faster.\n- Run the query in your database and store the results in a separate table. Connect the new table in your data source.\n\nFinally, click **CONNECT** .\nIn a moment, the data source fields list page appears. Click **CREATE REPORT** to start visualizing your data.\n\nNotes\n-----\n\n### Data types\n\nLooker Studio maps your database's built-in data types to a unified set of [data types](/looker/docs/studio/data-types). If Looker Studio encounters a column in your table or query of an unsupported type, it won't create a field for that column.\n\n### Firewall and database access\n\nTo allow Looker Studio to connect to and query databases that are behind a firewall, you will need to open access to one of the following IP addresses. You may also need to configure your database to accept traffic from these addresses. Consult the documentation for your specific database for instructions on how to do this.\n\n#### IP addresses\n\n- `142.251.74.0/23`\n\n- `2001:4860:4807::/48` (Optional, for platforms that support IPv6)\n\nLimits of the Amazon Redshift connector\n---------------------------------------\n\n- You can query a maximum of 150 K rows per query using this connector. If you exceed this limit, the data will be truncated.\n- Column headers (field names) must use ASCII characters only. Non-ASCII characters aren't supported.\n\nLicense\n-------\n\nThe Amazon Redshift connector was developed using the Amazon Redshift JDBC driver, which is distributed under the [Apache 2.0 license](https://github.com/aws/amazon-redshift-jdbc-driver/blob/master/LICENSE).\n\nTroubleshooting\n---------------\n\nSee the [Looker Studio troubleshooting guide](/looker/docs/studio/troubleshooting-guide) for a list of common error messages and steps to resolve them.\n\nRelated resources\n-----------------\n\n- [Create a data source](/looker/docs/studio/add-data-to-a-report)"]]