Running the Server
There are two ways to run SQL queries against your database:
dolt sql-server
starts a MySQL-compatible serverdolt sql
runs SQL queries from your shell without starting a server
dolt sql-server
The dolt sql-server
command runs a MySQL compatible server which clients can connect to and execute queries against. Any library or tool that can connect to MySQL can connect to Dolt.
The host, user, password, timeout, logging info and other options can be set on the command line or via a config file.
View the dolt sql-server
command documentation here.
Stopping the server
The dolt sql-server
process can be stopped using your operating system's process control mechanism. Dolt will stop when sent a signal like SIGHUP
, SIGQUIT
, SIGABRT
, or SIGKILL
.
A common way to send a SIGKILL
is to navigate to the shell running the dolt sql-server
process and Ctrl-C
.
Another common way to stop the server is to identify the process running dolt sql-server
and send a signal to it using the kill
command.
dolt sql
Using dolt sql
you can issue SQL statements against a local database without starting a server.
With no arguments, dolt sql
begins an interactive shell.
With the -q
flag, it executes queries specified as arguments.
You can also use STDIN
to the dolt sql
command to execute many SQL statements at once. This is useful for importing a dump from another database.
View the dolt sql
command documentation here.
Last updated