Home > Database > Mysql Tutorial > body text

嵌入式 数据库 SQLite 移植和测试

WBOY
Release: 2016-06-07 17:11:02
Original
1180 people have browsed it

一、测试 1. 从 sqlite 网站http://sqlite.org/download.html上下载最新的 sqlite 源码sqlite-autoconf-3070500.tar.gz,目前最新

一、测试

1. 从 sqlite 网站上下载最新的 sqlite 源码sqlite-autoconf-3070500.tar.gz,目前最新版本为 3.7.5

2. 解压缩源码,进入源码文件夹mkdir _install,,进行正确的配置 configure ,生成正确的Makefile

Configure 命令如下:

CC=/usr/local/arm-2007q1/bin/arm-none-linux-gnueabi-gcc CXX=/usr/local/arm-2007q1/bin/arm-none-linux-gnueabi-g++ ./configure --host=arm-linux --prefix=`pwd`/_install --disable-tcl

3. Make

4. Make install 将生成的内容拷贝到 ./configure –prefix 指定的目录中即 _install 文件夹中

5. 将编译得到的 sqlite3 拷贝到开发板文件系统/bin 目录下

将编译得到的 /lib 目录下的库文件拷贝到开发板文件系统/lib 目录下

让交叉编译器也支持sqlite3 的方法:

将编译得到的 /include 目录下的库文件拷贝到交叉编译器/include 目录下

将编译得到的 /lib 目录下的库文件拷贝到交叉编译器/lib 目录下

6. 在开发板中运行 sqlite3 如果出现以下提示说明sqlite 移植成功

SQLite version 3.7.5
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite

二、数据库测试;

1. 简单命令测试如下:

sqlite> create table film (number,name);
sqlite> insert into film values (1,'aaa');
sqlite> insert into film values (2,'bbb');
sqlite> select * from film;
1|aaa
2|bbb
sqlite>.quit

2. 交叉编译sqlite_test 应用程序测试 sqlite ,应用程序源码和Makefile 文件在压缩包sqlite_test.tar.bz2 中

测试命令:

./sqlite_test new.db "create table film (number,name)"

./sqlite_test test.db “insert into”

./sqlite_test test.db “select *from test.db”

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template