I have my sqlite3.exe file in C:\
and i want to create an sqlite database in C:\db\sqlite
.I have tried sqlite3 ex1 as suggested on the docs http://www.sqlite.org/sqlite.html but i get the error Error Near "sqlite3".
What is the correct way of creating a new database from the shell?.
SQLite CREATE Database In this SQLite tutorial, here is how you can create a new database: Open the Windows Command Line tool (cmd.exe) from the start, type “cmd” and open it. From the Installation and packages tutorial, you should now have created an SQLite folder in the “C” directory and copied the sqlite3.exe on it.
Start the sqlite3 program by typing "sqlite3" at the command prompt, optionally followed by the name the file that holds the SQLite database (or ZIP archive). If the named file does not exist, a new database file with the given name will be created automatically.
In SQLite, sqlite3 command is used to create a new SQLite database.
As new file is created in current directory, for creating file at different location you should follow this format:
eg. for storing file FILENAME.db at c:/users/xyz/abc you should type
sqlite>.open c:/users/xyz/abc/FILENAME.db
and then press enter a new file will be created at the mentioned path.
and now when you will type .databases
you will see your file listed in the list of databases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With