Install SQLite in Linux

Source: Internet
Author: User
Download sqlite-3.6.tar.gz unzip and copy it to the directory where you want to install it, I chose the usrlocalsqlite-3.3.6 and then in the terminal: # cdusrlo

Download the sqlite-3.3.6.tar.gz unzip and copy it to the directory you want to install, I chose/usr/local/sqlite-3.3.6 and then in the terminal: # cd/usr/lo

Download sqlite-3.3.6.tar.gz
Decompress and copy to the directory where you want to install it. What I chose is/usr/local/sqlite-3.3.6.
Then in the terminal:
# Cd/usr/local/sqlite-3.3.6
#./Configure
# Make
# Make install
# Make doc

An error is prompted during make.
../Sqlite-3.3.6/src/tclsqlite. c: In function 'dbupdatehandler ':
../Sqlite-3.3.6/src/tclsqlite. c: 333: warning: passing arg 3 of 'tcl _ ListObjAppendElement 'makes pointer from integer without a cast
......
This is a tcl-related error. You can first install ActiveTcl to solve it. If you do not need tcl support, this error can be avoided as follows:
#./Configure -- disable-tcl -- prefix =/usr/local/sqlite-3.3.6
# Make: If no file can be compiled is prompted, it is the first time make has been executed, and then the following is done. If this is the first compilation, no error will be prompted.
# Make install
# Make doc

Test whether the installation is successful
# Cd/usr/lcoal/sqlite-3.3.6
#./Sqlite3 text. db // This is also the way to enter the database

If the installation is successful, the following information appears:
SQLite version 3.3.6
Enter ". help" for instructions
Sqlite>
Next, you can operate it as you would on windows.

Ii. Basic SQLite operations

Perform the following operations: Create a table, insert, and query:

Sqlite> create table tbl1 (one varchar (10), two smallint );
Sqlite> insert into tbl1 values ('Hello! ', 10 );
Sqlite> insert into tbl1 values ('Goodbye ', 20 );
Sqlite> select * from tbl1;
Hello! | 10
Goodbye | 20
Sqlite>

Note that the semicolon must be included after each SQL statement.

Special commands to sqlite3:

Sqlite>. help

. Databases List names and files of attached databases
. Exit Exit this program

. Output FILENAME Send output to FILENAME
. Output stdout Send output to the screen

. Tables List the tables

,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.