- Как установить SQLite и браузер SQLite в Ubuntu
- Установка SQLite в Ubuntu
- Создание базы данных и таблицы SQLite
- Установка браузера SQLite в Ubuntu
- Удаление SQLite и браузера SQLite
- Downloads
- Windows
- Windows PortableApp
- macOS
- Homebrew
- Nightly builds
- Linux
- AppImage
- Snap packages
- Snap Release build
- Snap Nightly builds
- Arch Linux
- Fedora
- openSUSE
- Debian
- Ubuntu and Derivatives
- Stable release
- Nightly builds
- Other Linux
- FreeBSD
- How to Install SQLite and SQLite Browser in Ubuntu
- Install SQLite in Ubuntu
- Create SQLite Database and Table
- Installing SQLite Browser in Ubuntu
- Uninstall SQLite and SQLite Browser
- If You Appreciate What We Do Here On TecMint, You Should Consider:
- How to Install SQLite Browser in Ubuntu 20.04
- Installation of SQLite 3 in Ubuntu 20.04 LTS
- Installing SQLite Browser in Ubuntu 20.04 LTS
- Method #1: Install SQLite Browser Using Apt Repository
- Starting the SQLite Browser
- Uninstalling the SQLite Browser
- Method #2: Install SQLite Browser Using Snap
- Conclusion
Как установить SQLite и браузер SQLite в Ubuntu
SQLite — это легкая, небольшая и автономная СУБД. Популярные базы данных, такие как MySql, PostgreSQL и т. д. работают как клиент — сервер, и у них есть специальный процесс, выполняющий и контролирующий все аспекты работы базы данных.
А SQLite не имеет запущенного процесса и не имеет модели клиент — серверной. SQLite DB — это просто файл с расширениями .sqlite3 .sqlite .db. Каждый язык программирования имеет библиотеку для поддержки SQLite.
SQLite используется в таких программах как:
- Веб-браузеры (Chrome, Safari, Firefox).
- MP3-плееры, приставки и электронные гаджеты.
- Устройства на Android, Mac, Windows, iOS и iPhone.
Областей где используется SQLite очень много. Например каждый смартфон в мире имеет сотни файлов базы данных SQLite. На наш взгляд это довольно большое количество. Пока приступить к установке db.
Установка SQLite в Ubuntu
Настройка и установка SQLite очень проста, по сравнению с другими популярными базами данных, такими как MySql, Postgresql и т. д. Во-первых, обновите apt-cache, выполнив следующую команду.
Теперь проверьте, есть ли какие нибудь пакеты SQLite, которые доступны в репозитории apt. Для этого выполнив следующую команду.
Чтобы установить SQLite, выполните следующую команду.
Вы можете проверить установку, для этого запустите сеанс sqlite. Это можно сделать выполнив следующую команду.
Как видно из приведенного выше изображения, SQLite3 успешно установлен и работает с версией 3.33.0..
Создание базы данных и таблицы SQLite
База данных хранится в виде файла в вашей файловой системе. Вы можете создать базу данных при запуске сеанса sqlite, указав имя базы данных в качестве аргумента. Если БД доступна, она откроет базу данных, если нет, то создаст новую базу данных.
Если мы не передаем имя БД в качестве аргумента, то создается временная база данных в памяти, которая будет удалена после завершения сеанса. Здесь у меня нет никакой базы данных, поэтому я создам новую БД, упомянув имя db в качестве аргумента. Как только вы подключитесь к сеансу, вы можете запустить команду .databases, чтобы увидеть, какой файл прикреплен к базе данных.
$ sqlite3 /home/tecmint/test # создание тестовой базы данных в /home/tecmint
sqlite> .databases #команда для того чтобы увидеть, какой сеанс базы данных подключен
Теперь давайте создадим пример таблицы, выполнив следующие запросы.
# create table
sqlite> CREATE TABLE employee(
Name String,
age Int);
# Insert records
sqlite> insert into employee(Name, age)
VALUES (‘Tom’,25),
(‘Mark’,40),
(‘Steve’,35);
Вы можете запустить команду .tables, чтобы вывести список таблиц в базе данных.
sqlite> .tables # отображает список таблиц в базе данных
sqlite> .headers on # включить столбец для печати
sqlite> SELECT * FROM employee; # выбор записи из таблицы
Установка браузера SQLite в Ubuntu
Теперь, когда мы как установили и настроили sqlite3, мы также установим sqlite browser. Это простой графический инструмент для управления базами данных sqlite.
$ sudo apt install sqlitebrowser -y
Вы можете запустить приложение из меню «Пуск» или из терминала. Для запуска браузера из терминала выполните следующую команду.
Удаление SQLite и браузера SQLite
Для удаления SQLite, так и SQLite browser потребуется выполнить следующую команду.
$ sudo apt —purge remove sqlite3 sqlitebrowser
Вот и все. Если у вас есть какие-либо отзывы или советы, пожалуйста, используйте раздел комментариев, чтобы опубликовать их.
Downloads
Windows
Our latest release (3.12.2) for Windows:
Windows PortableApp
Note — If for any reason the standard Windows release does not work (e.g. gives an error), try a nightly build (below).
Nightly builds often fix bugs reported after the last release. рџ„
macOS
Our latest release (3.12.2) for macOS:
Homebrew
If you prefer using Homebrew for macOS, our latest release can be installed via Homebrew Cask:
Nightly builds
Download nightly builds for Windows and macOS here:
Linux
Our latest release is available as an AppImage, Snap packages, and distribution specific packages:
AppImage
Remember to change it’s permission bits to be executable before you run it. рџ„
Snap packages
Snap Release build
Snap Nightly builds
Other distribution specific instructions:
Arch Linux
Arch Linux provides an up to date version
Install with the following command:
Fedora
Install for Fedora (i386 and x86_64) by issuing the following command:
openSUSE
Debian
Note that Debian focuses more on stability rather than newest features. Therefore packages will typically contain some older version, compared to the latest release.
Update the cache using:
Install the package using:
Ubuntu and Derivatives
Stable release
For Ubuntu and derivaties, @deepsidhu1313 provides a PPA with the latest release here:
To add this ppa just type in these commands in terminal:
Then update the cache using:
Install the package using:
Ubuntu 14.04.X, 15.04.X, 15.10.X and 16.04.X are supported for now (until Launchpad decides to discontinue building for any series).
Ubuntu Precise (12.04) and Utopic (14.10) are not supported:
- Precise does not have a new enough Qt package in its repository by default, which is a dependency
- Launchpad does not support Utopic any more, which has reached its End of Life
Nightly builds
Nightly builds are available here:
To add this ppa, type these commands into the terminal:
Then update the cache using:
Install the package using:
Other Linux
On others, compile DB4S using the instructions in BUILDING.md.
FreeBSD
DB Browser for SQLite works well on FreeBSD, and there is a port for it (thanks to lbartoletti рџ„). DB4S can be installed using either this command:
How to Install SQLite and SQLite Browser in Ubuntu
SQLite is a lightweight, small and self-contained RDBMS in a C library. Popular databases like MySql, PostgreSQL, etc. works in the client-server model and they have a dedicated process running and controlling all the aspects of database operation.
But SQLite has no process running and has no client-server model. SQLite DB is simply an file with .sqlite3/.sqlite/.db extension. Every programming language has a library to support SQLite.
You can find SQLite being used in
- Web browsers (Chrome, Safari, Firefox).
- MP3 players, set-top boxes, and electronic gadgets.
- Internet of Things (IoT).
- Android, Mac, Windows, iOS, and iPhone devices.
There are lot more areas where SQLite is used. Every smartphone in the world has hundreds of SQLite database files and there are over one trillion databases in active use. That’s quite huge in numbers.
Install SQLite in Ubuntu
Setting up SQLite is simple compared to other popular databases like MySql, Postgresql, etc. First, update apt-cache by running the following command.
Now check if there are any SQLite packages available in the apt repository by running the following command.
To install the package run the following command.
You can validate the installation by starting the sqlite session by running the following command.
Start SQLite Session
You can see from the above image SQLite3 is successfully installed and running with version 3.33.0..
Create SQLite Database and Table
The database is simply stored as a file in your local file system. You can create a database when launching the sqlite session by mentioning the database name as an argument. If the database is available it will open the database if not it creates a new database.
If we are not passing the database name as an argument then a temporary in-memory database is created which will be deleted once the session is terminated. Here I don’t have any database so I will create a new DB by mentioning the DB name as an argument. Once you are connected to the session you can run the .databases command to see which file is attached to the database.
Create SQLite Database
Now let’s create a sample table by executing the following queries.
You can run the .tables command to list tables in the database.
Installing SQLite Browser in Ubuntu
Now that we have seen how to install and setup sqlite3 we will also install sqlite browser, a simple GUI tool to manage your sqlite databases.
You can launch the application from the start menu or from the terminal. To start from the terminal run the following command.
Database Browser for SQLite
Uninstall SQLite and SQLite Browser
Run the following command to remove both SQLite and SQLite browser.
That’s it for this article. If you have any feedback or tips please use the comment section to post it.
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
How to Install SQLite Browser in Ubuntu 20.04
The SQLite Browser is an application with a Graphical User Interface (GUI) that is used for performing CRUD operations and editing SQL DB files compatible with SQLite. This application also provides greater ease to users and developers in creating databases, as well as searching and editing data. The SQLite Browser uses an interface familiar to a spreadsheet so that there is no need to learn complicated SQL commands. This article shows you to install SQLite 3 and the SQLite Browser in Ubuntu 20.04 LTS using the apt and snap methods.
Installation of SQLite 3 in Ubuntu 20.04 LTS
Before installing the SQLite browser, you will first need to install SQLite3. Installing SQLite 3 in Ubuntu is as simple as installing any other package in Ubuntu.
First, update the apt-cache repository by issuing the following:
After updating the cache, install SQLite 3.
You can search for the SQLite packages in the apt repository to check whether they exist in the apt repository. To search for the SQLite packages in the apt repository, run the following command:
The output of this command will list all the packages in the apt repository related to SQLite. After searching for the desired package, if it exists in the list, you can install SQLite 3 using the simple apt install command in the terminal.
To install SQLite 3, run the command below:
Once the installation is completed, you will see the following:
You can verify the installation of SQLite 3 by running the sqlite3 –version command, as follows:
The latest version 3.31 of SQLite 3 can be seen in the screenshot above, which shows that SQLite 3 has been installed successfully.
Installing SQLite Browser in Ubuntu 20.04 LTS
After successfully installing SQLite 3, you are now ready to install and get started with the SQLite Browser application. The SQLite Browser package can be installed using either of two methods:
- Install SQLite Browser Using Apt Repository
- Install SQLite Browser Using Snap
The following sections show you how to install the SQLite Browser using both methods.
Method #1: Install SQLite Browser Using Apt Repository
To install the SQLite Browser using the apt repository, first, update your system’s apt-cache repository.
Next, install the SQLite Browser via the following command:
You will then be asked whether you want to continue to take additional disk space or quit the installation process. Press ‘y’ to continue the installation.
Once the installation of SQLite Browser has completed, you are now ready to launch and use the SQLite browser in your Ubuntu system.
Starting the SQLite Browser
To start the SQLite Browser, simply search for the SQLite Browser in the Application Menu.
Then, click the SQLite Browser Icon to open it.
Shown in the image above is the Welcome screen of the SQLite Browser.
You can verify the installation of SQLite Browser from the terminal by running the sqlitebrowser –version command in the terminal, as follows:
In the above screenshot, you can see the SQLite Browser version.
Uninstalling the SQLite Browser
To uninstall the SQLite Browser from your Ubuntu system, issue the following command:
As you can see in the screenshot above, the SQLite Browser has been uninstalled successfully.
Method #2: Install SQLite Browser Using Snap
To install SQLite Browser in Ubuntu via the snap repository, first, update the apt-cache repository.
Also, make sure that snap is installed on your Ubuntu system. If you do not have snap installed, run the command below to install snap:
After snap has successfully installed (or if you already have snap on your system), execute the sqlitebrowser installation command to install the SQLite Browser snap:
After running the above command, SQLite will be installed, and you will be able to use it for your computing needs.
Conclusion
The SQLite Browser is the browser used to perform CRUD operations and many other operations in the SQLite database. Installing SQLite onto your Ubuntu system can be very easy, as was clearly explained in this article.