

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 建立查詢輸出位置
<a name="creating-databases-prerequisites"></a>

如果您尚未在 Amazon S3 中設定查詢輸出位置，請執行下列先決條件步驟。

**若要建立查詢輸出位置**

1. 使用您用於 Athena 的相同 AWS 區域 和 帳戶，依照步驟 （例如，使用 Amazon S3 主控台） 在 [Amazon S3 中建立儲存貯](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket.html)體，以保留您的 Athena 查詢結果。您可將此儲存貯體設定為您的查詢輸出位置。

1. 前往 [https://console.aws.amazon.com/athena/](https://console.aws.amazon.com/athena/home) 開啟 Athena 主控台。

1. 如果這是您第一次造訪 Athena 主控台 AWS 區域，請選擇**探索查詢編輯器**以開啟查詢編輯器。此外，Athena 會於查詢編輯器中開啟。

1. 選擇 **Edit Settings** (編輯設定) 以在 Amazon S3 中設定查詢結果位置。  
![\[選擇編輯設定。\]](http://docs.aws.amazon.com/zh_tw/athena/latest/ug/images/getting-started-choose-view-settings.png)

1. 對於 **Manage settings** (管理設定)，請執行下列其中一項動作：
   + 在 **Location of query result** (查詢結果的位置) 方塊中，輸入您在 Amazon S3 中為查詢結果建立的儲存貯體路徑。在路徑中加上 `s3://` 作為字首。
   + 選擇 **Browse S3** (瀏覽 S3)，選擇您在目前區域建立的 Amazon S3 儲存貯體，然後選擇 **Choose** (選擇)。  
![\[在 Amazon S3 中指定要從 Athena 接收查詢結果的位置。\]](http://docs.aws.amazon.com/zh_tw/athena/latest/ug/images/getting-started-setting-results-location.png)

1. 選擇**儲存**。

1. 選擇 **Editor** (編輯器) 以切換至查詢編輯器。  
![\[選擇 Editor (編輯器)。\]](http://docs.aws.amazon.com/zh_tw/athena/latest/ug/images/getting-started-choose-editor.png)