Connecting by MySQL Protocol
Apache Doris adopts the MySQL network connection protocol. It is compatible with command-line tools, JDBC/ODBC drivers, and various visualization tools within the MySQL ecosystem. VeloDB Cloud also provides a browser-based Console for running SQL without installing a client. This guide is about how to connect to a VeloDB Cloud warehouse using MySQL Client, MySQL JDBC Connector, DBeaver, and the VeloDB Cloud Console.
Note:
The
FE_IP/FE_PORTexamples in the client sections apply to self-managed Apache Doris. For VeloDB Cloud connection details, log in to the VeloDB Cloud console, select the warehouse, open Connection in the left navigation pane, and copy the values from Connection Info or Connection Methods.
MySQL Client
Download MySQL Client from the MySQL official website for Linux. Currently, Doris is primarily compatible with MySQL 5.7 and later clients.
Extract the downloaded MySQL client. In the bin/ directory, find the mysql command-line tool. Execute the following command to connect to Doris:
# FE_IP represents the listening address of the FE node, while FE_QUERY_PORT represents the port of the MySQL protocol service of the FE. This corresponds to the query_port parameter in fe.conf and it defaults to 9030.
mysql -h FE_IP -P FE_QUERY_PORT -u USER_NAME
After login, the following message will be displayed.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 236
Server version: 5.7.99 Doris version doris-2.0.3-rc06-37d31a5
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
MySQL JDBC Connector
Download the corresponding JDBC Connector from the official MySQL website.
Example of connection code:
String user = "user_name";
String password = "user_password";
String newUrl = "jdbc:mysql://FE_IP:FE_PORT/demo?useUnicode=true&characterEncoding=utf8&useTimezone=true&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true";
try {
Connection myCon = DriverManager.getConnection(newUrl, user, password);
Statement stmt = myCon.createStatement();
ResultSet result = stmt.executeQuery("show databases");
ResultSetMetaData metaData = result.getMetaData();
int columnCount = metaData.getColumnCount();
while (result.next()) {
for (int i = 1; i <= columnCount; i++) {
System.out.println(result.getObject(i));
}
}
} catch (SQLException e) {
log.error("get JDBC connection exception.", e);
}
If you need to initially change session variables when connecting, you can use the following format:
jdbc:mysql://FE_IP:FE_PORT/demo?sessionVariables=key1=val1,key2=val2
DBeaver
Create a MySQL connection to Apache Doris:

Query in DBeaver:

VeloDB Cloud Console
The VeloDB Cloud Console provides the SQL Editor, a browser-based interface for running SQL against a warehouse. It lets you query data and manage SQL objects without installing the MySQL client.
To open the SQL Editor:
- Log in to the VeloDB Cloud console.
- In the upper-left corner, select the warehouse that you want to use.
- In the left navigation pane, click SQL Editor.
For details about query execution, results, query history, and query profiles, see SQL Editor.