7

I'm trying to access my sqlite database on my current directory at /c/wamp/www/laravel5 on my local project folder, with windows as my OS. I added the sqlite3 executable on the directory.

The database doesn't seem to open using git bash. When using the default command in windows command prompt it works seamlesly. sqlite3.exe storage/database.sqlite

Tried on Git Bash:

$ ./sqlite3.exe 

and

$ ./sqlite3.exe storage/database.sqlite

These didn't work. The error message is:

bash: sqlite3.exe: command not found

Here's a snapshot: enter image description here

I'd like to see the database tables and schema using git bash since it has cooler font colors compare with the windows cmd.

Any help would be greatly appreciated.

6
  • And what exactly do you mean with "didn't work"? Nothing? An error message? Your computer exploded? Commented Oct 22, 2015 at 7:55
  • Hi @CL. already updated the post, added the error message. Commented Oct 22, 2015 at 10:03
  • What is the current directory? (pwd) Commented Oct 22, 2015 at 15:29
  • Stated on the post /c/wamp/www/laravel5 Commented Oct 23, 2015 at 4:13
  • Show the output of ls -l. Commented Oct 23, 2015 at 8:15

2 Answers 2

19

if you have the same problem I had, then see my question here.

In short, using "winpty" to start sqlite3 worked:

$ winpty sqlite3
Sign up to request clarification or add additional context in comments.

3 Comments

still very useful! also works with mysql (i.e., winpty mysql)
This works, but then I can't Ctrl+C to exit sqlite anymore.
This is true. It gets into a state where I need /bin/kill to exit it if I issue any SQL commands other than sqlite3's own "begins with a dot" ones. I suspect any line I type that doesn't begin with a . will put it into this state.
6

Building on the previous answer by @user172431, add the following alias to your .bashrc

alias sqlite3="winpty sqlite3.exe"

This will make the workflow a tad quicker and feel like a ninja rock-star in the process. I use this shortcut via Git Bash

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.