How to install JSON-supported SQLite 3.9.1 on Ubuntu 15.04
Welcome to read our article on SQLite. SQLite is the most widely used SQL database engine in the world today. It can run without configuration or management. SQLite is a public-domain software. It is a relational database management system (RDBMS) used to store user-defined records in a large data table. For data storage and management, the database engine needs to process complex query commands that may obtain data from multiple tables and then generate reports and data summaries.
SQLite is a very small, lightweight, and does not require independent service processes or systems. It can run On UNIX, Linux, Mac OS-X, Android, iOS and Windows, has been used by a large number of software programs, such as Opera, Ruby On Rails, Adobe System, Mozilla Firefox, google Chrome and Skype.
1) basic requirements:
Installing SQLite on most platforms that support SQLite basically has no complicated requirements.
Let's log on to the Ubuntu server with sudo or root permissions on CLI or Secure Shell. Then update the system so that the software of the operating system can be updated to the new version.
On Ubuntu, use the following command to update the software source of the system.
#apt-get update
If you want to deploy SQLite on the newly installed Ubuntu, you need to install some basic system management tools, such as wget, make, unzip, and gcc.
To install wget, run the following command. If the system prompts, enter Y:
#apt-get install wgetmakegcc
2) download SQLite
Download SQLite from the official SQLite website, as shown below:
SQLite download
You can also directly copy the resource connection and use wget to download it on the command line, as shown below:
#wget https://www.sqlite.org/2015/sqlite-autoconf-3090100.tar.gz
Wget SQLite
After the download is complete, decompress the installation package, switch the working directory to the decompressed SQLite directory, and use the following command.
#tar-zxvf sqlite-autoconf-3090100.tar.gz
3) install SQLite
Now we need to start installing and configuring the downloaded SQLite. Compile and install SQLite on Ubuntu and run the configuration script:
root@ubuntu-15:~/sqlite-autoconf-3090100# ./configure –prefix=/usr/local
SQLite Installation
After the prefix is configured, run the following command to compile the installation package.
root@ubuntu-15:~/sqlite-autoconf-3090100#make
source='sqlite3.c' object='sqlite3.lo' libtool=yes \
DEPDIR=.deps depmode=none /bin/bash./depcomp \
/bin/bash./libtool --tag=CC --mode=compile gcc-DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.9.1\" -DPACKAGE_STRING=\"sqlite\ 3.9.1\" -DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.9.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_POSIX_FALLOCATE=1 -I. -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2 -c -o sqlite3.lo sqlite3.c
After running the preceding command, install SQLite on Ubuntu and run the following command.
#make install
SQLite Make Install
4) test SQLite Installation
To ensure that SQLite 3.9 is successfully installed, run the following command.
# sqlite3
The SQLite version is displayed on the command line.
Testing SQLite Installation
5) Use SQLite
SQLite is easy to use. For detailed usage, enter the following command in the SQLite console.
sqlite>.help
All available commands and detailed descriptions are displayed.
SQLite Help
Now, run the SQLite command to create a database.
To create a new database, run the following command.
# sqlite3 test.db
Create a new table.
sqlite> create table memos(text, priority INTEGER);
Use the following command to insert data.
sqlite> insert into memos values('deliver project description',15);
sqlite> insert into memos values('writing new artilces',100);
To view the inserted data, run the following command.
sqlite> select *from memos;
deliver project description|15
writing new artilces|100
Or use the following command to exit.
sqlite>.exit
Using SQLite3
Conclusion
This article describes how to install the latest version of SQLite that supports JSON1. SQLite supports JSON1 from 3.9.0. This is a great library that can be embedded into the application and can be used to effectively and easily manage resources. We hope you will find this article helpful. Please feel free to give us feedback on your problems and difficulties.
Analysis on the combination of storage and data types in SQLite3
SQLite3 installation and basic operations
Simple Application of SQLite databases in Ubuntu 12.04
How to install SQLite in Ubuntu 12.04
Basics of SQLite Database
SQLite details: click here
SQLite: click here