博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
使用SQLite打开本地*.db文件
阅读量:7100 次
发布时间:2019-06-28

本文共 4572 字,大约阅读时间需要 15 分钟。

hot3.png

1.下载安装文件:

官网下载地址:http://www.sqlite.org/download.html
32位安装包:http://www.sqlite.org/2016/sqlite-tools-win32-x86-3130000.zip
64位补丁:http://www.sqlite.org/2016/sqlite-dll-win64-x64-3130000.zip
2.安装:

解压之后,将64位补丁包dll文件与exe文件放在相同目录下即可

4ff750c1da61b25c9be5953b716a478dd58.jpg

3.使用:
sqlite3 .exe 才438KB  用它打开.db文件。方法如下:
把sqlite3 .exe 放到D:/下面.  把test.db文件放在D:/A 目录下
1>进入到要打开的*.db目录下,操作:
cd /d C:\Users\Administrator\AppData\Roaming\HAOCHUANG\Temp\dcmdb\6ac09ac3.fe31.4b51.b31b.14816ffb60c
dir 可见:imageremotetest.db
2.使用绝对路径运行并打开db文件:
"E:\Tools_PKG\DevTools\DBTools\sqlite-tools-win32-x86-3130000\sqlite3.exe" imageremote.db
3.使用sqlite命令操作数据库:
    >.table   --查看表名
    >select * from  test limit 1,100  --查看1到100条记录  

见图:

08bc38a2f627bcc22587d1a7ab9c40d74b1.jpg

5.常用命令:

可以参考帮助:

sqlite> .help.auth ON|OFF           Show authorizer callbacks.backup ?DB? FILE      Backup DB (default "main") to FILE.bail on|off           Stop after hitting an error.  Default OFF.binary on|off         Turn binary output on or off.  Default OFF.changes on|off        Show number of rows changed by SQL.clone NEWDB           Clone data into NEWDB from the existing database.databases             List names and files of attached databases.dbinfo ?DB?           Show status information about the database.dump ?TABLE? ...      Dump the database in an SQL text format                         If TABLE specified, only dump tables matching                         LIKE pattern TABLE..echo on|off           Turn command echo on or off.eqp on|off|full       Enable or disable automatic EXPLAIN QUERY PLAN.exit                  Exit this program.explain ?on|off|auto? Turn EXPLAIN output mode on or off or to automatic.fullschema ?--indent? Show schema and the content of sqlite_stat tables.headers on|off        Turn display of headers on or off.help                  Show this message.import FILE TABLE     Import data from FILE into TABLE.indexes ?TABLE?       Show names of all indexes                         If TABLE specified, only show indexes for tables                         matching LIKE pattern TABLE..limit ?LIMIT? ?VAL?   Display or change the value of an SQLITE_LIMIT.load FILE ?ENTRY?     Load an extension library.log FILE|off          Turn logging on or off.  FILE can be stderr/stdout.mode MODE ?TABLE?     Set output mode where MODE is one of:                         ascii    Columns/rows delimited by 0x1F and 0x1E                         csv      Comma-separated values                         column   Left-aligned columns.  (See .width)                         html     HTML 
code insert SQL insert statements for TABLE line One value per line list Values delimited by .separator strings tabs Tab-separated values tcl TCL list elements.nullvalue STRING Use STRING in place of NULL values.once FILENAME Output for the next SQL command only to FILENAME.open ?FILENAME? Close existing database and reopen FILENAME.output ?FILENAME? Send output to FILENAME or stdout.print STRING... Print literal STRING.prompt MAIN CONTINUE Replace the standard prompts.quit Exit this program.read FILENAME Execute SQL in FILENAME.restore ?DB? FILE Restore content of DB (default "main") from FILE.save FILE Write in-memory database into FILE.scanstats on|off Turn sqlite3_stmt_scanstatus() metrics on or off.schema ?PATTERN? Show the CREATE statements matching PATTERN Add --indent for pretty-printing.separator COL ?ROW? Change the column separator and optionally the row separator for both the output mode and .import.shell CMD ARGS... Run CMD ARGS... in a system shell.show Show the current values for various settings.stats ?on|off? Show stats or turn stats on or off.system CMD ARGS... Run CMD ARGS... in a system shell.tables ?TABLE? List names of tables If TABLE specified, only list tables matching LIKE pattern TABLE..timeout MS Try opening locked tables for MS milliseconds.timer on|off Turn SQL timer on or off.trace FILE|off Output each SQL statement as it is run.vfsinfo ?AUX? Information about the top-level VFS.vfslist List all available VFSes.vfsname ?AUX? Print the name of the VFS stack.width NUM1 NUM2 ... Set column widths for "column" mode Negative values right-justifysqlite>

转载于:https://my.oschina.net/u/3636678/blog/3028827

你可能感兴趣的文章
ID生成策略之Annotation的三个方式
查看>>
我的第一个Kotlin应用
查看>>
HPE C7000的enclosure IP mode使用
查看>>
局域网XP系统无密码访问共享
查看>>
【iphone游戏开发】iphone-Cocos2D游戏开发之一:游戏术语大解析
查看>>
Neutron结合SDN的架构分析
查看>>
《转》VMware vSphere 5.1 学习系列之三:安装 ESXi
查看>>
SuSe配置网络
查看>>
SEO高级搜索指令
查看>>
搭建一个新手学习AI/ML的Python环境
查看>>
全球供应链环境下的上海国际物流建设
查看>>
阿里云推荐码
查看>>
Tigase Load Tests again - 500k user connections
查看>>
Objective-c 处理动态类型的方法
查看>>
拷贝构造函数与赋值运算符重载
查看>>
JavaRebel的简单配置
查看>>
List(泛型)类型转换陷阱,hibernate 原生查询BigInteger 转 Long 出错问题
查看>>
rust安装
查看>>
CGI、FastCGI、PHP-CGI、PHP-FPM、Spawn-FCGI解析
查看>>
Ubuntu安装svn服务备忘录
查看>>