Files with the extension .db, which are lightweight databases SQLite, are widely used in the Android operating system to store application settings, caches, message history and other service information. An ordinary user often needs to access this data, for example, to restore lost correspondence in the messenger, extract contacts from a backup copy, or simply analyze what data a particular application collects.

However, you cannot simply open such a file on a smartphone. Unlike Word documents or images, a database is a binary structure that requires special software to correctly interpret and display the content in a readable form. Without specialized software, you will see only a set of incomprehensible symbols and hieroglyphs.

In this article we will analyze in detail all the available ways to view and edit SQLite databases on a mobile device. We will consider both methods that require rights root to access system folders, and solutions for ordinary users that allow you to work with transferred database files.

Features of database storage in Android

All applications on Android store their local data in a private system directory. By default, the path to these files looks like /data/data/package_name/databases/. The main feature is that this directory is protected by superuser access rights. This means that without obtaining root access you will not be able to copy the database file from system memory for later opening.

If your device does not have superuser rights, you can still work with the databases data, but only with those that have already been exported to an external drive or internal memory in an accessible folder. Many backup applications, such as Titanium Backup or Swift Backup, allow you to upload .db files to open directories, where they can already be analyzed.

โš ๏ธ Warning: Directly editing system databases without first creating a backup copy can lead to complete crashing applications or losing all your data. Always make a backup before any manipulations!

The file structure SQLite is universal and does not depend on the operating system. This means that a database created on Android can be opened on a computer running Windows or macOS if the appropriate software is available. However, for quick work directly on the phone, there are special tools optimized for touch control.

Applications for viewing SQLite without root access

If your goal is simply to view the contents of a database file that is already located in an accessible folder (for example, in Download or on an SD card), you do not have to hack the system. There are a number of viewer applications that work in user mode.

One โ€‹โ€‹of the most popular and functional solutions is the application SQLite Viewer. It allows you to open files, view tables, run simple SQL queries, and even export data to CSV or JSON format. The interface of such apps is usually intuitive: you select a file through the built-in explorer, and the application displays the structure of the database in the form of convenient tables.

Another worthy option is DB Browser for SQLite (ports for mobile devices). Although the classic version is known on the PC, there are adapted mobile clients that support reading table schemas and navigating through records. They are especially useful if you need to quickly find a specific value among thousands of rows of data.

  • ๐Ÿ“ฑ SQLite Viewer - a lightweight and fast viewer with support for data export.
  • ๐Ÿ” SQL Editor - an application that allows you not only to view, but also to perform queries against the database.
  • ๐Ÿ’พ Database Manager - a universal tool for managing various types of databases on the device.
๐Ÿ“Š What type of files do you most often try to open on Android?
.db (Databases)
.apk (Installers)
.log (System logs)
Other formats

Professional editors for users with Root access

For those who have superuser rights, the possibilities of working with SQLite are significantly expanded. You get direct access to the system catalog /data/data/, which allows you to edit databases of running applications on the fly. This is often used by developers for debugging or advanced users to modify games and system settings.

The leader in this category is the application SQLite Editor (by developer Speed Software). This is a powerful all-in-one tool that integrates into the system and allows you to open any base, even protected ones. The application supports creating new tables, changing the structure of existing ones, executing complex SQL scripts and bulk editing records.

Another popular tool is Root Explorer or its modern analogues, such as Mixplorer with installed plugins. These file managers have a built-in database browsing feature. When you click on a file .db they automatically offer to open it in the built-in viewer, which is very convenient for quickly checking the content without launching a separate application.

โ˜‘๏ธ Preparing to edit the database

Done: 0 / 4

It is important to understand that interfering with the operation of system applications by editing their databases can disrupt digital signatures or the logic of the software. Some instant messengers and banking applications use mechanisms to check data integrity, and if changes are detected, they can block their launch.

Using computer utilities to analyze databases

Sometimes the smartphone screen is too small for comfortable analysis of large tables containing thousands of rows. In such cases, it is more rational to copy the database file to your computer and use desktop software. This is especially true when recovering data after a failure or deep analysis of the application structure.

The most famous tool in this area is DB Browser for SQLite. It is a free and open source app available for Windows, macOS and Linux. It provides a complete visual interface for managing databases: creating, designing, editing, executing queries and viewing results in tabular form.

An alternative is an extension SQLite Viewer for the Google Chrome browser or specialized plugins for IDEs, such as Android Studio or IntelliJ IDEA. If you are developing for Android, then the tool Database Inspector as part of Android Studio is the most professional solution that allows you to see changes in the database in real time while the emulator or connected device is running.

Tool name Platform Requires Root Main function
SQLite Editor Android Yes (for system ones) Full editing and SQL execution
DB Browser Windows/Mac/Linux No Visual analysis and export of data
Root Explorer Android Yes File manager with DB viewing
SQLite Viewer Android/Web No Quick viewing without editing
What are WAL files?

Next to the database file (.db) you can often find files with the extension .db-wal and .db-shm. These are Write-Ahead Logging log files. They contain temporary data that has not yet been finally saved to the main database file. When deleting or moving the main .db file, it is better to leave these accompanying files in place or delete them only after the application is closed correctly, otherwise the data may be lost.

Step-by-step guide for extracting and opening the file

Let's consider the algorithm of actions for a user who wants to get the database of a specific application and open it. If you have root access, the process will take a couple of minutes. If not, you will need to make a backup using a special application.

First you need to find the exact path to the database. Usually it is located in /data/data/com.example.app/databases/. Using a file manager with superuser rights (for example, Root Explorer), go to this directory. Find the file with the desired name (often it is called simply main.db or has a function name, for example messages.db).

Copy this file to an accessible location, for example, to a folder Download in the internal storage. After this, you can close the file manager and launch a viewer application, such as SQLite Viewer. Select copied file and you will see a list of tables.

Copy path:

/data/data/com.whatsapp/databases/msgstore.db -> /sdcard/Download/

If you are using a computer, connect your phone in file transfer mode (MTP), find the copied file in the Download folder and drag it to your desktop. Next, open it via DB Browser for SQLite. This will allow you to safely experiment with the data without risk. the functionality of the main application on the phone.

๐Ÿ’ก

When copying messenger databases (WhatsApp, Telegram), make sure that the application is completely closed (unloaded from RAM), otherwise the copied file may be damaged or not contain the latest messages.

Possible problems and methods for solving them

When working with databases, users often encounter the โ€œDatabase disk imageโ€ error is malformed" (The image of the database disk is distorted). This means the file is damaged. This often happens if the phone was turned off while data was being recorded or if the application was forcibly stopped by the system.

In some cases, the database file may be encrypted. Many modern applications, especially instant messengers and banking software, use encryption SQLCipher. When you try to open such a file in a regular viewer, you will either not see the tables or receive an access error. To work with such databases, a decryption key is required, which is stored in a protected area of โ€‹โ€‹the application memory.

โš ๏ธ Attention: Versions of the SQLite format may differ. If the file was created in a very new version of the library, the old viewer may not display some data types or specific indexes correctly.

It is also worth considering that application interfaces and file paths may change with updates to the Android operating system. What worked on Android 10 may not be available or moved to Android 14 due to tightened security policies (Scoped Storage). Always check the relevance of paths in the documentation for a specific application.

๐Ÿ’ก

The safest way to work with foreign databases is to copy them to external storage and analyze them on a computer or in an isolated viewer application, and not directly edit them in the system partition.

Frequently asked questions (FAQ)

Is it possible to open the WhatsApp database without root access?

Directly from the system folder - no. However, you can create a local backup of your chats through the settings of WhatsApp itself. Backup files (often named msgstore.db.crypt14) are saved in a folder Android/media/com.whatsapp/WhatsApp/Databases. To open them, you must first remove the encryption suffix (if you have the key) or use specialized utilities to extract data from encrypted backups.

Is it safe to edit values โ€‹โ€‹in the game database?

It's risky. Changing values โ€‹โ€‹(for example, the amount of gold or lives) may be considered by the anti-cheat system as a violation, which will lead to an account ban in online games. In offline games, this can cause crashes or saves in an incorrect state. Always make a copy of the file before editing.

Why can't SQLite Viewer see my files?

Modern versions of Android (11 and higher) have file system access restrictions. Make sure you have given the app permission to access all files in your system settings (Settings โ†’ Applications โ†’ Special. access โ†’ Access to all files). Also check that the file actually has an extension .db and is not hidden.

How to delete a database if the application does not start?

If the application crashes due to a damaged database, deleting it can help reset the application state to the initial state. Go to Settings โ†’ Applications, find the desired application, select Storage and press Clear data. This will delete all databases and application settings, returning it to the โ€œas after installationโ€ state.