关键字: 数据库 出处:http://www.linuxdiyf.com/bbs/archiver/tid-69089.html
sqlite for linux 安装
下载 sqlite-3.3.5.tar.gz
解压并拷贝至你想要安装到的目录下,我选择的是/usr/local/sqlite-3.3.5
接着在终端里:
# cd /usr/local/sqlite-3.3.5
# ./configure
# make
# make install
# make doc
make的时候提示错误
../sqlite-3.3.5/src/tclsqlite.c: In function `DbUpdateHandler':
../sqlite-3.3.5/src/tclsqlite.c:333: warning: passing arg 3 of `Tcl_ListObjAppendElement' makes pointer from integer without a cast
../sqlite-3.3.5/src/tclsqlite.c: In function `tclSqlFunc':
../sqlite-3.3.5/src/tclsqlite.c:419: warning: passing arg 1 of `Tcl_NewByteArrayObj' discards qualifiers from pointer target type
这个都是tcl相关的错误,可以先安装ActiveTcl以解决.假如你不需要tcl支持,那么这个错误可以这样避免:
# ./configure --disable-tcl --prefix=/usr/local/sqlite-3.3.5
# make 如果提示没有可以编译的文件,则是第一次make时已经执行过了,接着下面做就可以了;如果此次是第一次编译,应该不会再提示出错了
# make install
# make doc
测试是否安装成功
# cd /usr/lcoal/sqlite3.3.5
# ./sqlite3 text.db
如果安装成功,会出现下面这样的信息
SQLite version 3.3.5
Enter ".help" for instructions
sqlite>
[root@inbelle ipsecmc]# sqlite user.db
SQLite version 3.6.16
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
sqlite> .tables
p2pvpn_client
sqlite> select * from p2pvpn_client;
group001|test001|123456
group001|test002|123456
group001|test003|123456
group001|test004|123456
group001|test005|123456
group002|test001|123456
group002|test002|123456
group002|test003|123456
group002|test004|123456
group002|test005|123456
sqlite> .schema
CREATE TABLE p2pvpn_client(
groupname varchar(32) NULL,
username varchar(32) NULL,
password varchar(32) NULL);
sqlite> insert into "p2pvpn_client" values ("group001","test006","123456");
sqlite> select * from p2pvpn_client;
group001|test001|123456
group001|test002|123456
group001|test003|123456
group001|test004|123456
group001|test005|123456
group002|test001|123456
group002|test002|123456
group002|test003|123456
group002|test004|123456
group002|test005|123456
group001|test006|123456
sqlite>
sqlite> .exit
最后不是在默认的目录中,要配置环境变量 :
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking(PATH)
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
评论