Why do I get a "sqlite3: not found" error on a rooted Nexus One when I try to open a database using the adb shell? Why do I get a "sqlite3: not found" error on a rooted Nexus One when I try to open a database using the adb shell? android android

Why do I get a "sqlite3: not found" error on a rooted Nexus One when I try to open a database using the adb shell?


As an alternative (may not be secure or even good idea though) you can always upload the sqlite3 binary to /system/bin this worked for me:

First lets mount /system/ to allow read/write (rw)

$ adb shell$ su# mount -o remount,rw /system

in another terminal change directory (cd) to where sqlite3 is and lets push it

$ lssqlite3$ adb push sqlite3 /sdcard/

Now back to the other shell lets copy and change permissions of the binary

# cat /sdcard/sqlite3 > /system/bin/sqlite3# chmod 4755 /system/bin/sqlite3

Now lets mount back /system/ as read only (ro)

# mount -o remount,ro /system

And now we can use sqlite3 from shell:

# sqlite3 /data/data/com.telly/databases/fun.dbSQLite version 3.7.4Enter ".help" for instructionssqlite> .tablesandroid_metadata  lulz               

Note: I'm using the sqlite3 binary that comes with "SuperOneClickv1.6.5-ShortFuse"

You can always pull sqlite3 binary from emulator:

Start an emulator and then from a terminal

$ adb pull /system/xbin/sqlite3

If you are lazy like me you can download one right here for ICS or before or for Jelly Bean and later here

Make sure to use the proper one for your Android version as you may get eloc_library[1306]: 14446 cannot locate 'sqlite3_enable_load_extension'... or similar errors on execute


On the Android emulator, sqlite3 is in /system/xbin. There is no /system/xbin on a Nexus One (Android 2.2). Hence, I suspect that sqlite3 is not installed on the Nexus One.


From the answer of evelio, I had problem to push the sqlite3 file to /system/bin. So, instead, I have pushed it to the /sdcard.

In this thread I found the right Solution (answer of Kila):How can I install sqlite3 on rooted NexusOne runs Gingerbread

$ adb push sqlite3 /sdcard/$ adb shell$ su# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system# dd if=/sdcard/sqlite3 of=/system/bin/sqlite3# chmod 4755 /system/bin/sqlite3# mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system 

It works on my Samsung Galaxy S II with 2.3.3.