閱讀824 返回首頁    go 小米 go MIUI米柚


8.6 使用本地客戶端連接分析型數據庫__第八章 在生產中使用分析型數據庫_使用手冊_分析型數據庫-阿裏雲

若用戶希望在本地PC上連接和管理分析型數據庫,則可以使用MySQL官方的命令行工具,或建議使用SQL WorkBench/J工具進行連接和管理。

使用MySQL官方命令行工具時,支持5.1.x/5.5.x/5.6.x版本的MySQL CLI,連接範例如下:

  1. [cloud@iZ28unhwyqvZ ~]$ mysql -h<DOMAIN_URL> -P<PORT> –u<ACCESS_KEY_ID> -p<ACCESS_KEY_SECRET> -D<DB_NAME>
  2. Reading table information for completion of table and column names
  3. You can turn off this feature to get a quicker startup with -A
  4. Welcome to the MySQL monitor. Commands end with ; or g.
  5. Your MySQL connection id is 968288632
  6. Server version: 5.1.31-mysql-ads
  7. Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
  8. Oracle is a registered trademark of Oracle Corporation and/or its
  9. affiliates. Other names may be trademarks of their respective
  10. owners.
  11. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
  12. mysql>

需要注意的是,連接時建議使用 -D 提前指定數據庫名,或是在連接成功後立刻使用use語句切換數據庫,否則執行其他命令時會報”only or are allowed from admin database connection”錯誤。

更多的,我們會使用一些本地GUI工具在PC機上進行開發調試,很多工具均能部分上兼容分析型數據庫。綜合來看兼容性最好的跨平台GUI工具是SQL WorkBench/J,目前可以在 https://www.sql-workbench.net/ 上免費下載。

下載好SQL Workbench/J程序後,還需要下載MySQL JDBC 驅動(如:https://dev.mysql.com/downloads/connector/j/ 中下載)。下載驅動後,打開SQL WorkBench/J程序,選擇 File -> Manage Drivers,選擇MySQL後填寫剛剛下載的驅動jar包路徑。

一切配置完畢後,點擊File -> Connect Window,Driver選擇MySQL,按照 jdbc:mysql://:/ 格式填寫URL,並在用戶名/密碼中填寫合法賬號的ACCESS_KEY_ID和ACCESS_KEY_SECRET,如下圖所示:

8-7-1

配置完畢後點擊ok,就可以連接到分析型數據庫,執行DDL或DML等。

最後更新:2016-12-07 10:04:19

  上一篇:go 8.5 使用阿裏雲訪問控製(RAM)__第八章 在生產中使用分析型數據庫_使用手冊_分析型數據庫-阿裏雲
  下一篇:go 8.7 使用kettle導入本地數據__第八章 在生產中使用分析型數據庫_使用手冊_分析型數據庫-阿裏雲