Connect to NebulaGraph¶
NebulaGraph supports multiple types of clients, including a CLI client, a GUI client, and clients developed in popular programming languages. This topic provides an overview of NebulaGraph clients and basic instructions on how to use the native CLI client, Nebula Console.
You can use supported clients or console to connect to NebulaGraph.
Use Nebula Console to connect to NebulaGraph¶
- You have started NebulaGraph services.
- The machine you plan to run Nebula Console on has network access to NebulaGraph services.
The Nebula Console version is compatible with the NebulaGraph version.
The same version of Nebula Console and NebulaGraph is the most compatible. There may be compatibility issues when connecting to NebulaGraph with a different version of Nebula Console. You may be unable to connenct to NebulaGraph due to the compatibiltiy issue and an error message
incompatible version between client and serveris displayed.
On the nebula-console page, select a Nebula Console version and click Assets.
We recommend that you select the latest release.
In the Assets area, find the correct binary file for the machine where you want to run Nebula Console and download the file to the machine.
(Optional) Rename the binary file to
For Windows, rename the file to
On the machine to run Nebula Console, grant the execute permission of the nebula-console binary file to the user.
For Windows, skip this step.
$ chmod 111 nebula-console
In the command line interface, change the working directory to the one where the nebula-console binary file is stored.
Run the following command to connect to NebulaGraph.
- For Linux or macOS:
$ ./nebula-console -addr <ip> -port <port> -u <username> -p <password> [-t 120] [-e "nGQL_statement" | -f filename.nGQL]
- For Windows:
> nebula-console.exe -addr <ip> -port <port> -u <username> -p <password> [-t 120] [-e "nGQL_statement" | -f filename.nGQL]
Parameters and descriptions are as follows.
Shows the help menu.
Sets the IP address of the graphd service. The default address is 127.0.0.1.
Sets the port number of the graphd service. The default port number is 9669.
Sets the username of your NebulaGraph account. Before enabling authentication, you can use any existing username. The default username is
Sets the password of your NebulaGraph account. Before enabling authentication, you can use any characters as the password.
Sets an integer-type timeout threshold of the connection. The unit is second. The default value is 120.
Sets a string-type nGQL statement. The nGQL statement is executed once the connection succeeds. The connection stops after the result is returned.
Sets the path of an nGQL file. The nGQL statements in the file are executed once the connection succeeds. The result will be returned and the connection stops then.
You can find more details in the Nebula Console Repository.