SQL WorkBench/J

更新时间:
复制 MD 格式

SQL WorkBench/J is a DBMS-independent, cross-platform SQL query and analysis tool for connecting to an AnalyticDB for MySQL cluster.

Prerequisites

Before you use SQL WorkBench/J, complete the following prerequisites.

  • Review the compatibility between SQL WorkBench/J and AnalyticDB for MySQL. For more information, see Compatibility overview.
  • You have installed a MySQL JDBC driver.

  • Install SQL WorkBench/J. Add the IP address of the machine running SQL WorkBench/J to the whitelist of your AnalyticDB for MySQL cluster. For more information, see Configure a whitelist.
  • You have obtained a public endpoint for the AnalyticDB for MySQL cluster if you plan to connect over the internet. For more information, see Apply for or release a public endpoint.

Notes

To enable PrepareStatement in SQL WorkBench/J, see Enable PrepareStatement for clients in different programming languages.

Procedure

  1. Open SQL WorkBench/J and choose File > Manage Drivers.
    Note When you use SQL WorkBench/J for the first time, you must add the JDBC driver's JAR file. For future connections, you can skip to step 3.
  2. On the Manage drivers page, select MySQL as the driver, add the driver JAR file, and click OK.
    The Classname is com.mysql.jdbc.Driver, and the Sample URL is jdbc:mysql://hostname:port/name_of_database.
  3. Choose File > Connect window, and configure the parameters on the Select Connection Profile page.
    Parameter Description
    New profile Enter a name for the connection profile for easy identification.
    Driver Select MySQL.
    URL

    The endpoint of your AnalyticDB for MySQL cluster. You can find the endpoint on the Cluster Information page in the AnalyticDB for MySQL console.

    Username

    The user name of your database account in the AnalyticDB for MySQL cluster. The account can be a:

    • privileged account

    • standard account

    Password

    The password that corresponds to the user name.

  4. After configuring the parameters, click Test to verify the connection. If the test is successful, click OK to connect to the AnalyticDB for MySQL cluster.