erikgrinaker / toydb

Distributed SQL database in Rust, written as a learning project
Apache License 2.0
5.99k stars 555 forks source link

Can't connect to the database #40

Closed Tembocs closed 3 years ago

Tembocs commented 3 years ago

I've cloned the toydb repository and do a cargo build --release successful. I then went into target/release directory and try to run ./toysql and got the following error message:

Error: Internal("No connection could be made because the target machine actively refused it. (os error 10061)")

I run the same command with administrator privilege and got the same error message. I'm on Windows 10 x64 Version 2004 OS build 20201.1000.

erikgrinaker commented 3 years ago

Hi @Tembocs! toysql is the client program, you'll need to start the toydb server first which the client can communicate with. You can start a single-node server manually like this (pull latest master first for a bugfix), although you'd have to use Windows equivalents of the commands:

$ cargo build --release
$ mkdir data
$ echo "data_dir: ./data" >config.yml
$ ./target/release/toydb -c config.yml 
09:17:13 [INFO] No peers specified, starting as leader
09:17:13 [INFO] Listening on 0.0.0.0:9605 (SQL) and 0.0.0.0:9705 (Raft)

Then, in a separate terminal, start the toysql client:

$ ./target/release/toysql 
Connected to toyDB node "toydb". Enter !help for instructions.
toydb> SELECT '👋';
👋