SQLite - How to create a local SQLite3 database file on Mac?
To create a local SQLite database file on your mac:
- Open Terminal
- Navigate to the folder to store the database file
- Run
SQLite3 db_name.db
ortouch db_name.db
to create a new database file
Replace the db_name
with name of the database you want to create, sameple
for instance.
You can use the file extension as .sql
, .sqlite
, or .db
.
From Terminal, you can run .database
command to see the list of existing databases.
Now use Finder to go to the newly created database file, double-click on it to open (or you can right-click and choose to open with TablePlus). From there, you can create a new table using TablePlus GUI Tool for SQLite.
New to TablePlus? TablePlus is a modern, native tool with an elegant UI that allows you to simultaneously manage multiple databases such as MySQL, PostgreSQL, SQLite, Microsoft SQL Server and more.
Not on Mac? Download TablePlus for Windows.
On Linux? Download TablePlus for Linux
Need a quick edit on the go? Download TablePlus for iOS.