问题描述
我是 Rails 和 SQLite 的新手.
I'm a fresher of rails and SQLite.
这是我的场景:我在 Windows Vista 机器上安装了 sqlite3
.c:\rails\blog
还实现了一个博客应用程序代码.我调出命令提示符并直接转到 c:\rails\blog\db
.我运行命令 sqlite3
进入数据库控制台.当我使用 .databases
命令时,没有列出任何数据库?为什么?我做错了什么?
Here is my scenario:I had sqlite3
installed on my Windows Vista machine.A blog application code had also been implemented at c:\rails\blog
.I brought up my command prompt and went directly to c:\rails\blog\db
.I ran the command sqlite3
to enter the database console.when I used the .databases
command, no database was listed out? Why?What have I done wrong?
推荐答案
你可能没有打开数据库本身
You probably didn't open the database itself
sqlite3 database.db
请记住,在 SQLite 中,数据库只是一个文件.只要你不打开或附加一个,就没有打开的.另一方面,当你刚打开数据库时 .databases
感觉有点没用,因为你知道你刚刚打开的是哪个.
Remember, that in SQLite a database is just a file. As long as you don't open or attach one, there is no open one. On the other hand when you just open the database .databases
feels a kind of useless, because you know which one you just opened.
这篇关于sqlite3 - 如何使用 .databases 命令列出数据库名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!