The latest version of SQLite always comes pre-installed within Mac OSX or macOS. You don’t have to download or install anything else, it’s located in the directory:
To open SQLite on Mac
It should show something like this:
SQLite version 3.24.0 2018-06-04 14:10:15 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open FILENAME" to reopen on a persistent database. sqlite>
If for any reasons, your Mac hasn’t installed SQLite, follow these steps to install it from Source:
- Go to SQLite download page.
sqlite-autoconf-XXXXXXX.tar.gzfrom the source code section. At the time I’m writing this, it’s
- Run these commands (open Terminal app):
cd ~/Downloads #or where you saved the tar file. tar xvfz sqlite-autoconf-3240000.tar.gz cd sqlite-autoconf-3240000 ./configure --prefix=/usr/local make make install
And now SQLite is installed on your Mac.
If you have hombrew, you can install SQLite with the command:
brew install sqlite3
To create a new SQLite database from terminal:
- Navigate to the target folder.
touch db_name.dbto create a new database file.
To open, browse, edit and update data in your SQLite database, use TablePlus for SQLite. It’s a free, native, and intuitive GUI tool for relational database on Mac.
You can download it here.