# Running SQL queries on a database with phpMyAdmin

> phpMyAdmin lets you run SQL queries directly against your database tables from within cPanel.

Source: https://www.kualo.com/knowledgebase/cpanel-databases/running-sql-queries-on-a-database-with-phpmyadmin
Updated: 2026-06-11

---

phpMyAdmin lets you run SQL queries directly against your database tables, giving you full control over your data beyond what the point-and-click interface offers.

## Opening the SQL query window

There are two ways to reach the SQL query window in phpMyAdmin.

**From the database view:**

1. Log in to cPanel and open phpMyAdmin.
2. In the left-hand panel, click the database you want to work with.
3. Click the **SQL** tab at the top of the main panel.

**From the table view:**

1. In the left-hand panel, click the specific table you want to query.
2. Click the **SQL** tab. phpMyAdmin pre-fills a basic `SELECT` statement for that table, which you can edit or replace.

## Running a query

1. Type your SQL command into the query box. For example, to find every customer in London:

```sql
SELECT * FROM customers WHERE city = 'London';
```

2. Click **Go** to run it. phpMyAdmin shows the matching rows below, along with how many were returned.

![Running a SELECT query and viewing the results in phpMyAdmin](https://kb-cdn.kualo.com/2f/24/2f24b6d4a4a3854dc8ae6a28b279ac4d837de08a.png)

:::warning
SQL commands such as `DROP`, `DELETE`, and `ALTER` change or remove data and cannot be undone. Always back up your database before running them - you can generate a backup from the **Export** tab in phpMyAdmin.
:::

## Learning SQL syntax

For a full reference on SQL syntax, see the [MySQL documentation](https://dev.mysql.com/doc/).


---

_Source: Kualo Knowledgebase — https://www.kualo.com/knowledgebase/cpanel-databases/running-sql-queries-on-a-database-with-phpmyadmin · © Kualo Ltd._
