# 1.1.1.安裝My SQL (Mac OS X)

* 1.先到My SQL官網, 選擇Downloads-> Community, 下載DMG Archieve
* 2.若是沒有會員得先註冊會員, 隨後將會發出驗證信給你
* 3.登入後繼續進行下載
* 4.打開下載回來的.dmg檔進行安裝, 一直按確認即可,注意當安裝結束後會出現一組暫時的密碼, 將密碼記下來, 當access到My SQL時會使用到 (密碼很重要)
* 5.確認安裝是否成功: 打開command line輸入

  ```
    cd /usr/local/mysql
    sudo ./bin/mysqld_safe
  ```

  * 接著他會停住一段時間, 按ctrl+d跳出來後再次輸入:

    ```
     bg
    ```
  * 畫面會出現:

    ```
     [1]+ sudo ./bin/mysqld_safe &
    ```
  * 再次輸入bg, 畫面會出現:

    ```
     -bash: bg: job 1 already in background
    ```
  * 表示My SQL已在在背景中run起來了
* 6.將My SQL的路徑設到bash\_profile中, 進到My SQL command:
  * 在command line中輸入:

    ```
    sudo nano ~/.bash_profile
    ```
  * 並在編輯器加入下面code:

    ```
    export PATH=/usr/local/mysql/bin:$PATH
    ```
  * 關閉並重新開一個新的command line, 輸入:

    ```
     mysql -u root -p
    ```
  * 此時要輸入的密碼就是一開始記下來的密碼,輸入後即可進到My SQL的命令列中


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jen-hsuan-hsieh.gitbook.io/database/chapter1/11-mysqlzai-max-osx-shang-de-bi-ji/11an-zhuang-my-sql-mac-os-x.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
