在 Windows 上配置 SQLite环境
|
admin
2024年8月21日 14:44
本文热度 1310
|
前言
SQLite的一个重要的特性是零配置的、无需服务器,这意味着不需要复杂的安装或管理。它跟微软的Access差不多,只是一个.db格式的文件。但是与Access不同的是,它不需要安装任何软件,非常轻巧。
SQLite零配置的、无需服务器
不需要安装任何数据库服务器,目前我本机上(Windows10)还没有安装SQLite任何环境,可以直接创建一个.db格式的文件作为SQLite测试数据库。






SQLite数据库管理工具下载
找到适配自己电脑系统的tools下载,配置。
- sqlite-tools-win-x64-3440000.zip包含了一系列命令行工具,用于管理 SQLite 数据库文件,包括命令行 shell 程序、sqldiff.exe 程序和 sqlite3_analyzer.exe 程序。这些工具可以帮助用户执行各种数据库管理任务,比如执行 SQL 命令、进行数据库文件比较、以及分析 SQLite 数据库性能等操作。

环境配置
- 创建SQLite文件夹,文件夹位置E:\program files\SQLite,文件夹位置可自定义;
- 将下载完成的sqlite-tools-win-x64-3440000.zip压缩包解压到E:\program files\SQLite中;

- 我的电脑右击=>属性=>高级系统设置=>高级=>环境变量=>系统变量=>Path=>编辑,将SQLite地址文件夹地址添加进去;


使用命令行创建SQLite数据库文件
- 使用Windows命令提示符(即cmd)打开对应数据库文件

在命令提示符下,输入以下命令来打开SQLite命令行:sqlite3
输入以下命令来创建一个新的数据库文件(例如MyTest.db):
.open MyTest.db


该文章在 2024/8/21 14:44:56 编辑过