> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connecting to SQLite from the command line

> Learn How to Connect to SQLite From Command Line! Just Follow Our Easy, Step-By-Step SQLite3 Guide! Access Your SQLite Databases With Ease!

This article describes how to connect to SQLite from the command line using the *sqlite3* program. You can use the *sqlite3* program as a quick and easy way to access SQLite databases directly.

## Connecting to SQLite from the command line

To connect to SQLite from the command line, follow these steps:

1. Log in to your account [using SSH](/docs/using-ssh-secure-shell).

2. At the command line, type the following command, replacing ***example.db*** with the name of the database file that you want to use:

   ```bash theme={null}
   sqlite3 example.db
   ```

   > 📘 Note
   >
   > The database filename can be anything you want. If the database file does not exist, SQLite creates it. If the database file already exists, SQLite opens the database contained in the file.

3. After you access a database, you can use regular SQL statements to run queries, create tables, insert data, and more. Additionally:

   * To show the tables in the database, type the following command at the **sqlite>** prompt:

     ```bash theme={null}
     .tables
     ```

   * To view the structure of a table, type the following command at the **sqlite>** prompt. Replace ***table*** with the name of the table that you want to view:

     ```bash theme={null}
     .schema table
     ```

   * To view a complete list of *sqlite3* commands, type `.help` at the **sqlite>** prompt.

   * To exit the *sqlite3* program, type `.quit` at the **sqlite>** prompt.

## More information

**What is SQLite?**

*SQLite* is a lightweight database management solution. It offers its users a high-performance, very dependable SQL database engine. SQLite's code is available within public domain making it free for use for every private or commercial purpose. SQLite has been built into every mobile device and almost every computer. In fact, SQLite is the world's most widely used database engine.

SQLite is a unique SQL solution because it doesn't require a separate server process. Instead, it reads and writes right on disk files. A disk file contains a comprehensive SQL database complete with multiple tables, views and triggers. As a cross-platform file format, you are able to copy between 32-bit and 64-bit storage systems.

SQLite is:

* Serverless

* Self-contained

* Zero-configuration

* Transactional

**Learn more about SQLite**

* To view information about the *sqlite3* program from the command line, type the following command:

```bash theme={null}
man sqlite3
```

* To view the SQLite online documentation for the *sqlite3* program, please visit [https://www.sqlite.org/cli.html](https://www.sqlite.org/cli.html).

## Related articles

* [Connecting to SQLite using PHP](/docs/connect-to-sqlite-using-php)
