10

I am using android sqlite3 command line tool. How do I repeat the last command that I executed (similar to the / in sqlplus)? Tried up arrow and . - both didnt work. I am on Mac :(

1
  • 2
    Did you solve it? I'm having some problems with the installation of the compiled sqlite3 file (following pktangyue's answer). Commented Oct 19, 2013 at 21:49

3 Answers 3

2

I now fall into the same problem.

When I type up, it prints ^[[A.

when I type left, it prints ^[[D. And it is similar to down and right

And I found this question( Sqlite using command line) and solove it.

First, rename the sqlite3 to sqlite3_bak in android tools to make it disable, or you can directly remove it, if you can make sure you will not use it again.

Second, download the "autoconf" source from http://www.sqlite.org/download.html (second link, currently to http://www.sqlite.org/sqlite-autoconf-3071502.tar.gz ):

then cd to the decompressed directory and compile it via the terminal

$ ./configure
$ make
$ sudo make install

Third, put your "new sqlite3 binary" to /opt/local/bin directory or set a soft-link to this file. And source your .bash_profile or .bashrc.

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

2 Comments

Could you be more specific about the last part? Android shell will use sqlite3 file installed in the device/emulator, not the computer, so why copy to /opt/local/bin (device doesn't even has this directory) or update .bash_profile?
In device it's in /system/xbin, I overwrote this sqlite3 with the compiled executable but for some reason it doesn't work
0

FYI - on my Raspberry Pi 3, not logged in as admin.

Go to https://github.com/robdelacruz/compile-sqlite3 and download the .zip file.

$ unzip ~/Downloads/compile-sqlite3-master.zip
$ cd ~/compile-sqlite3-master
$ sudo apt install libreadline-dev libncurses-dev
$ make clean
$ make all
$ make install
$ sqlite3

You should be good to go, but if not then check that you're not still running the old executable.

$ whereis sqlite3
sqlite3: /usr/bin/sqlite3 /usr/local/bin/sqlite3
$ ls -l /usr/bin/sqlite3
-rwxr-xr-x 1 root root 1382624 Mar 11 19:33 /usr/bin/sqlite3
$ ls -l /usr/local/bin/sqlite3
-rwxr-xr-x 1 root staff 4845796 Feb 18 20:23 /usr/local/bin/sqlite3

If you are still running the old exe then copy the new exe over the old exe or amend your search path so, when you type sqlite3 at the command prompt, the new exe is the one you run. I did the former.

$ sudo cp /usr/bin/sqlite3 /usr/local/bin/sqlite3

This worked for me.

Comments

-1

I might have just imagined it and I can't check just now but can you not just press the up arrow key?

1 Comment

Works on windows. Now I see you are using it on Mac. Sorry can't help you with that.

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.