This article belongs to the Getting Started Guide. It tells you how to run BaseX in client-server mode from command-line.
- Run one of the
basexserverstop.batto gracefully shut down the server.
- If you have installed BaseX on Windows, click on the BaseX HTTP Server (Start) icon, which will start both the HTTP Server used for Web Applications and the database server. With BaseX HTTP Server (Stop), you can shut down the server process.
If you have not chosen an admin password yet (e.g., via the Windows installer), you can specify an initial
PASSWORD command in your terminal:
basexserver -c PASSWORD BaseX [Server] Server was started (port: 1984). Password: _
By default, the server listens to the port
Ctrl+c will close all connections and databases and gracefully shut down the server process.
Database clients are started similarly:
- Run one of the
- Execute the following command:
java -cp BaseX.jar org.basex.BaseXClient
- If you have installed BaseX on Windows, click on the BaseX Client icon.
At startup, you need to enter your credentials. The initial password of the
admin user is
admin; it can be changed with the
The BaseX command-line client provides similar features to the standalone client. The major difference is that all commands will be executed by the BaseX server instance. As a consequence, paths/URIs to resources need to be resolvable by the server (file contents will not be transfered to the server).
Username and password can also be specified as command-line option. To evaluate commands without entering the console mode, you can use the
-c option on the command line:
basexclient -V -Uadmin -Padmin -c "CREATE DB input <example/>; XQUERY /" Database 'input' created in 13.85 ms. <example/> Query: / Parsing: 0.18 ms Compiling: 0.04 ms Evaluating: 0.12 ms Printing: 0.07 ms Total Time: 0.41 ms Hit(s): 1 Item Updated: 0 Items Printed: 10 Bytes Read Locking: local [input] Write Locking: none Query "user" executed in 0.41 ms.
If you want to communicate with the database server programmatically, we provide clients for various programming languages.