Sqlite 简明教程
SQLite - Installation
SQLite 以其出色的零配置功能而闻名,这意味着不需要复杂设置或管理。本章将引导你完成在 Windows、Linux 和 Mac OS X 上设置 SQLite 的过程。
SQLite is famous for its great feature zero-configuration, which means no complex setup or administration is needed. This chapter will take you through the process of setting up SQLite on Windows, Linux and Mac OS X.
Install SQLite on Windows
-
Step 1 − Go to SQLite download page, and download precompiled binaries from Windows section.
-
Step 2 − Download sqlite-shell-win32-.zip and sqlite-dll-win32-.zip zipped files.
-
Step 3 − Create a folder C:>sqlite and unzip above two zipped files in this folder, which will give you sqlite3.def, sqlite3.dll and sqlite3.exe files.
-
Step 4 − Add C:>sqlite in your PATH environment variable and finally go to the command prompt and issue sqlite3 command, which should display the following result.
C:\>sqlite3
SQLite version 3.7.15.2 2013-01-09 11:53:05
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
Install SQLite on Linux
如今,几乎所有版本的 Linux 操作系统都已随附 SQLite。因此,只需发出以下命令即可检查你的计算机上是否已安装 SQLite。
Today, almost all the flavours of Linux OS are being shipped with SQLite. So you just issue the following command to check if you already have SQLite installed on your machine.
$sqlite3
SQLite version 3.7.15.2 2013-01-09 11:53:05
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
如果你看不到以上结果,则表示你的 Linux 计算机上未安装 SQLite。以下是安装 SQLite 的步骤 -
If you do not see the above result, then it means you do not have SQLite installed on your Linux machine. Following are the following steps to install SQLite −
-
Step 1 − Go to SQLite download page and download sqlite-autoconf-*.tar.gz from source code section.
-
Step 2 − Run the following command −
$tar xvfz sqlite-autoconf-3071502.tar.gz
$cd sqlite-autoconf-3071502
$./configure --prefix=/usr/local
$make
$make install
上述命令将在你的 Linux 机器上完成 SQLite 的安装。你可以按照上面说明的进行验证。
The above command will end with SQLite installation on your Linux machine. Which you can verify as explained above.
Install SQLite on Mac OS X
尽管 Mac OS X 的最新版本预安装了 SQLite,但如果你没有安装,那么只需按照以下步骤操作 −
Though the latest version of Mac OS X comes pre-installed with SQLite but if you do not have installation available then just follow these following steps −
-
Step 1 − Go to SQLite download page, and download sqlite-autoconf-*.tar.gz from source code section.
-
Step 2 − Run the following command −
$tar xvfz sqlite-autoconf-3071502.tar.gz
$cd sqlite-autoconf-3071502
$./configure --prefix=/usr/local
$make
$make install
上述过程将在你的 Mac OS X 机器上完成 SQLite 的安装。你可以通过执行以下命令进行验证 −
The above procedure will end with SQLite installation on your Mac OS X machine. Which you can verify by issuing the following command −
$sqlite3
SQLite version 3.7.15.2 2013-01-09 11:53:05
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
最后,你将获得 SQLite 命令提示符,可以在其中为你的练习执行 SQLite 命令。
Finally, you have SQLite command prompt where you can issue SQLite commands for your exercises.